Dear Support
My chart is being updated about 10 times per second. The values displayed in the left axis are integers and can sometimes vary quite a lot. Is there an easy way to obtain the largest DISPLAYED label in the left axis. Note its not the largest left-axis value Im interested in because that may not be displayed.
If you check the attached image the largest displayed left axis label is 3,600. However that could drop to say 850 which would change the position of the bottom chart relative to the top image.
many thanks
Dave
How to obtain largest Left Axis (y-axis) label?
How to obtain largest Left Axis (y-axis) label?
- Attachments
-
- tChartImage.PNG (67 KiB) Viewed 9569 times
-
- Guru
- Posts: 1603
- Joined: Fri Nov 15, 2002 12:00 am
Re: How to obtain largest Left Axis (y-axis) label?
Hello Dave,
You should be able to use the Axis.Maximum property, as this displays the maximum value of the drawn axis. An example of this would be the following, where we set the left axis to a maximum value 200 units below the actual maximum, but still the actual (drawn) value is calculated in the Maximum property, e.g.Dave wrote: ↑Fri Jan 04, 2019 5:11 pmMy chart is being updated about 10 times per second. The values displayed in the left axis are integers and can sometimes vary quite a lot. Is there an easy way to obtain the largest DISPLAYED label in the left axis. Note its not the largest left-axis value Im interested in because that may not be displayed.
Code: Select all
private void InitializeChart()
{
Line line = new Line(tChart1.Chart);
line.FillSampleValues();
tChart1.Axes.Left.SetMinMax(line.YValues.Minimum, line.YValues.Maximum - 200);
}
private void button2_Click(object sender, EventArgs e)
{
MessageBox.Show(tChart1.Axes.Left.Maximum.ToString());
}
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 |
Re: How to obtain largest Left Axis (y-axis) label?
Thanks Chris!