zooming

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
Vikas Aggarwal
Newbie
Newbie
Posts: 1
Joined: Thu Aug 31, 2006 12:00 am

zooming

Post by Vikas Aggarwal » Fri Sep 08, 2006 11:24 am

we want to get the axis data (range) after zooming.

We populate the chart by binding it to columns of a dataset and at x-axis we have the LabelMembers (entity names) and at y axis we have data.

Now after zooming (horizontal) we want to retrieve the filtered data on the x-axis, i.e we would like to get the names of the entities that remain on the x-axis after zooming.

Say intitially there were 10 entities on x-axis and after zooming there remain 4, we want to get these 4 entities (either as a string or by their index).

Can anyone please help me in this?

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Post by Narcís » Fri Sep 08, 2006 12:02 pm

Hi Vikas,

Yes, you could try doing something like this:

Code: Select all

    private void Form1_Load(object sender, EventArgs e)
    {
      Random y = new Random();
      for (int i = 0; i < 25; i++)
      {
        points1.Add(y.Next(), "Point num. " + (i + 1).ToString());
      }

      tChart1.Zoom.Direction = Steema.TeeChart.ZoomDirections.Horizontal;
      listBox1.Items.Clear();
    }

    private void tChart1_Zoomed(object sender, EventArgs e)
    {
      Bitmap bmp = tChart1.Bitmap; //Trick to internally draw the chart so that properties have been updated.
      for (int i = points1.FirstVisibleIndex; i < points1.LastVisibleIndex; i++)
      {
        listBox1.Items.Add(points1.Labels[i]);
      }
    }

    private void tChart1_UndoneZoom(object sender, EventArgs e)
    {
      listBox1.Items.Clear();
    }
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

Post Reply