TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
-
rh12
- Newbie
- Posts: 1
- Joined: Tue Jan 11, 2005 5:00 am
Post
by rh12 » 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:
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);
}
-
Narcís
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
-
Contact:
Post
by Narcís » Mon Jun 26, 2006 1:05 pm
Hi rh12,
It works fine for me using this code:
Code: Select all
private void Form1_Load(object sender, EventArgs e)
{
Axis lAxis = new Axis(false, false, tChart1.Chart);
lAxis.SetMinMax(0, 50);
lAxis.Automatic = false;
tChart1.Chart.Axes.Custom.Add(lAxis);
Axis rAxis = new Axis(false, true, tChart1.Chart);
rAxis.SetMinMax(0, 200);
rAxis.Automatic = false;
tChart1.Chart.Axes.Custom.Add(rAxis);
for (int i = 1; i <= 2; i++)
{
Line seriesLine = new Line();
seriesLine.FillSampleValues();
if (i == 1)
{
seriesLine.CustomVertAxis = lAxis;
}
else
{
seriesLine.CustomVertAxis = rAxis;
}
tChart1.Series.Add(seriesLine);
}
}