Axis auto scaling / several axes
Posted: Mon Jun 26, 2006 12:51 pm
How does one turn off autoscaling? I would like to draw two different types of graphs in the same chart.
They should have two different y-axes, with fixed max and min values. However, setting Automatic to false on the axis does not work, the graphs are still autoscaled:
They should have two different y-axes, with fixed max and min values. However, setting Automatic to false on the axis does not work, the graphs are still autoscaled:
Code: Select all
Axis lAxis = new Axis(false, false, myChart);
lAxis.SetMinMax(0, 50);
lAxis.Automatic = false;
myChart.Chart.Axes.Custom.Add(lAxis);
Axis rAxis = new Axis(false, true, myChart);
rAxis.SetMinMax(0, 200);
rAxis.Automatic = false;
myChart.Chart.Axes.Custom.Add(rAxis);
for(int i=1; i<=2; i++)
{
Line seriesLine = new Line();
seriesLine.DataSource = table1;
seriesLine.XValues.DataMember = "time";
seriesLine.YValues.DataMember = "value";
if(i == 1)
{
seriesLine.CustomVertAxis = lAxis;
}
else
{
seriesLine.CustomVertAxis = rAxis;
}
myChart.Series.Add(seriesLine);
}