My setup is much like the one described in http://www.quinn-curtis.com/qxy/topic.asp?TOPIC_ID=706, however, I have a different issue.
I have 4 Y-axes and their placement is wrong if they are disabled and later re-enabled. If I update a scale limit afterwards, it will put it in the correct location.
Anyway, I am able to reproduce it with your RTStockDisplay example so you have code to play with. I can send you the .cs file if you let me know where. I basically added two buttons, "hide" and "unhide" the right y-axis and moved some parameter variables out to have access to them. The extra code is below.
Depending on how long it takes between hiding and unhiding, it seems like the position of the axis varies. If you wait 10 seconds or so, it will be off screen apparently.
To reproduce (see extra code below): Click "Hide". Wait 1 second. Click "Unhide". The axis will be offset further to the right than expected (should not move). If you click "Unhide" again, it will reposition it and it is where I would expect it to be in the first place.
Note: earlier in intial set-up, I offset the Y-axes as follows:
yaxis2.SetAxisIntercept(xaxis.AxisMax + 500);
Added a hide and unhide button similar to the zoom/restore buttons.
private void hide_Button_Click(object sender, System.EventArgs e)
{
EnableAxisY2(false);
this.UpdateDraw();
}
private void unhide_Button_Click(object sender, System.EventArgs e)
{
pTransform2.SetScaleStartY(1960);
pTransform2.SetScaleStopY(1980);
yaxis2.CalcAutoAxis();
yAxisLab2.CalcAutoAxisLabels();
yaxis2.SetAxisIntercept(xaxis.AxisMax + 500);
EnableAxisY2(true);
this.UpdateDraw();
}
private void EnableAxisY2(bool isEnable)
{
int chartEnable = (isEnable) ? ChartObj.OBJECT_ENABLE : ChartObj.OBJECT_DISABLE;
scrollFrame2.SetChartObjEnable(chartEnable);
lineplot2.SetChartObjEnable(chartEnable);
rtPlot2.SetChartObjEnable(chartEnable);
yaxis2.SetChartObjEnable(chartEnable);
yAxisLab2.SetChartObjEnable(chartEnable);
}
Thank you for your help. This is the source of much frustration.