Read Zoomed Values

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
jzarech
Newbie
Newbie
Posts: 58
Joined: Mon Jul 07, 2008 12:00 am

Read Zoomed Values

Post by jzarech » Sat Jun 18, 2022 12:42 pm

Hi Steema,

When I zoom into a chart I'd like to get the zoomed MinX , MinY, MaxX, and MaxY values and thought it would be in the Zoomed event but am finding it challenging to figure this out. Please see attached screenshots. I'm doing something wrong.

Thanks as always!
Joseph
Attachments
results.jpg
results.jpg (31.28 KiB) Viewed 7275 times
Code.jpg
Code.jpg (82.22 KiB) Viewed 7275 times

Pep
Site Admin
Site Admin
Posts: 3295
Joined: Fri Nov 14, 2003 5:00 am
Contact:

Re: Read Zoomed Values

Post by Pep » Tue Jul 19, 2022 9:34 am

Hello,

using the following code works fine. Could you please check?

Code: Select all

        Steema.TeeChart.TChart _chart = new Steema.TeeChart.TChart();
        private void Form1_Load(object sender, EventArgs e)
        {
            Controls.Add(_chart);

            var line = new Steema.TeeChart.Styles.Line(_chart.Chart);
            line.XValues.DateTime = true;

            line.FillSampleValues();

            _chart.Axes.Bottom.Labels.Angle = 90;
            _chart.Zoomed += _chart_Zoomed;
        }

        private void _chart_Zoomed(object? sender, EventArgs e)
        {
            MessageBox.Show("Min YVal:" + _chart.Axes.Left.Minimum.ToString() +
                " | Max YVal:" + _chart.Axes.Left.Maximum.ToString());

            MessageBox.Show("Min XVal:" + DateTime.FromOADate(_chart.Axes.Bottom.Minimum).ToString() + 
                " | Max XVal:" + DateTime.FromOADate(_chart.Axes.Bottom.Maximum).ToString());
        }

jzarech
Newbie
Newbie
Posts: 58
Joined: Mon Jul 07, 2008 12:00 am

Re: Read Zoomed Values

Post by jzarech » Tue Jul 19, 2022 8:46 pm

Thanks, I will try this.

Post Reply