Contour Intraction with trackbar

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
amol
Advanced
Posts: 231
Joined: Tue Mar 29, 2005 5:00 am

Contour Intraction with trackbar

Post by amol » Wed Jul 23, 2014 12:58 pm

Hi Steema Support,
We want to create contour and its interaction with the track bar with the chart(contour) when we scroll it.
imgs1.jpg
Fig 1 image
imgs1.jpg (40.04 KiB) Viewed 5525 times
As shown in fig-1, when we scroll the track bar then contour properties changes as shown in fig-2 below
img2.jpg
Fig.2 image
img2.jpg (111.06 KiB) Viewed 5522 times
It will so helpful for us if you please provide any alternative solution.

Thanks in advance.

Thanks and Regards
Planoresearch

Christopher
Guru
Posts: 1603
Joined: Fri Nov 15, 2002 12:00 am

Re: Contour Intraction with trackbar

Post by Christopher » Thu Jul 24, 2014 1:10 pm

amol wrote: It will so helpful for us if you please provide any alternative solution.
I'm afraid I'm not entirely sure how I can help you here. Windows Forms has a TrackBar Class which you can use for the TrackBar. The question is: which property of the Contour series do you want to change when the trackbar is changed? I'm afraid I cannot make that decision for you.

It seems to me that the trackbar could represent "levels" of a dataset, the dataset being a 3-dimensional surface, say, and the contour being a 2-dimensional representation of it at different levels. A very simple example of what I mean could look like this:

Code: Select all

    Contour contour;
    List<List<double>> yValues;
    private void InitializeChart()
    {
      tChart1.Aspect.View3D = false;
      contour = new Contour(tChart1.Chart);
      Random rnd = new Random();
      yValues = new List<List<double>>();

      for (int i = 0; i < 10; i++)
      {
        yValues.Add(new List<double>());

        for (int j = 0; j < 100; j++)
        {
          yValues[i].Add(rnd.NextDouble());
        }
      }

      AddValues(0);

      trackBar1.Minimum = 0;
      trackBar1.Maximum = 9;
      trackBar1.LargeChange = 1;
      trackBar1.ValueChanged += trackBar1_ValueChanged;
    }

    private void AddValues(int index)
    {
      for (int x = 0; x < 10; x++)
      {
        for (int z = 0; z < 10; z++)
        {
          contour.Add(x, yValues[index][x * z], z);
        }
      }
    }

    void trackBar1_ValueChanged(object sender, EventArgs e)
    {
      contour.Clear();
      AddValues(trackBar1.Value);
    }
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

Post Reply