Hi There
I'm adding a Styles.Line series to a chart which has the axes scaling set to Automatic.
Adding the series is causing the X axis scaling to change with undesirable results.
I would like to keep the Automatic scaling as it works well for the data series - is there a way to prevent it from changing the scale when certain Line series are added to the chart?
Many Thanks
Line Series and Axes Automatic Scaling
-
- Guru
- Posts: 1603
- Joined: Fri Nov 15, 2002 12:00 am
Re: Line Series and Axes Automatic Scaling
Hello Jon,
however, what this does mean is that when you turn Automatic back to true, the bottom axes will readjust to fit all the values on the next repaint. The only way to maintain control of axes min and max, when wanting all series visible, is to control the values manually (Maximum, Minimum properties, or SetMinMax() method).
One way to do this would be to disable Automatic scaling when adding in certain line series, e.g.JonM wrote: I would like to keep the Automatic scaling as it works well for the data series - is there a way to prevent it from changing the scale when certain Line series are added to the chart?
Code: Select all
private void InitializeChart()
{
tChart1.Aspect.View3D = false;
tChart1.Series.Add(typeof(Line)).FillSampleValues();
}
private void button4_Click(object sender, EventArgs e)
{
tChart1.Axes.Bottom.Automatic = false;
Random rnd = new Random();
tChart1.Series.Add(typeof(Line));
for (int i = 0; i < 100; i++)
{
tChart1[1].Add(i, rnd.Next(2000));
}
}
Best Regards,
Christopher Ireland / Development & Support Steema Software Avinguda Montilivi 33, 17003 Girona, Catalonia Tel: 34 972 218 797 http://www.steema.com |
Instructions - How to post in this forum |