Page 1 of 1

zooming

Posted: Fri Sep 08, 2006 11:24 am
by 9092368
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?

Posted: Fri Sep 08, 2006 12:02 pm
by narcis
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();
    }