Persistence mode

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
icecream
Newbie
Newbie
Posts: 20
Joined: Thu Aug 07, 2008 12:00 am

Persistence mode

Post by icecream » Thu Feb 05, 2015 6:37 pm

Hello,

Please let me know whether it is possible to display histograms in persistence mode using TeeChart? If yes, which version supports it?
Some explanations
Suppose we have a continuously updated histogram. Each time it represents some value it should keep a trace. Color intensity of the traces should be higher in those place where the histogram was more frequent. This feature have latest oscilloscopes.
Image

Thanks.

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

Re: Persistence mode

Post by Narcís » Fri Feb 06, 2015 3:11 pm

Hello icecream,

There's no built-in functionality to do that. However, what I see in the image can be achieve manually combining ColorGrid and Bar series as shown here:

Code: Select all

      tChart1.Aspect.View3D = false;
      tChart1.Legend.Visible = false;
      tChart1.Width = 100;
      tChart1.Height = 300;
      tChart1.Axes.Bottom.MaximumOffset = 1;

      Steema.TeeChart.Styles.ColorGrid colorGrid1 = new Steema.TeeChart.Styles.ColorGrid(tChart1.Chart);

      const int maxVal = 10;

      for (int i = 0; i < 1; i++)
      {
        for (int j = 0; j < maxVal; j++)
        {
          colorGrid1.Add(i, 0, j);
        }
      }

      Steema.TeeChart.Styles.Bar bar1 = new Steema.TeeChart.Styles.Bar(tChart1.Chart);

      bar1.MultiBar = Steema.TeeChart.Styles.MultiBars.None;
      bar1.Marks.Visible = false;
      bar1.ColorEach = true;

      Random y = new Random();

      for (int i = 0; i < 100; i++)
      {
        bar1.Clear();
        double tmp = y.Next(maxVal);

        int index = colorGrid1.ZValues.IndexOf(tmp);
        colorGrid1.YValues[index] += 1;

        bar1.Add(0.5, tmp, colorGrid1.StartColor); 
      }
If that's not what you are looking for please provide more detailed information about how your chart should exactly be.
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

icecream
Newbie
Newbie
Posts: 20
Joined: Thu Aug 07, 2008 12:00 am

Re: Persistence mode

Post by icecream » Fri Feb 06, 2015 5:51 pm

Thank you Narcis.

I am afraid it won't work for me. When maxVal is 255 the background is gray because of cells borders. Even if there would be a way to not draw a borders (I was not able to find it) the problem is that size of the chart is less than maxVal.
Image

I was thinking about drawing a lines (e.g. for last 1000 samples) and update their color using some algorithm. However, think it will be very slow. By the way, grid also may be slow.

Thanks.

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

Re: Persistence mode

Post by Narcís » Mon Feb 09, 2015 9:03 am

Hi icecream,
icecream wrote: Even if there would be a way to not draw a borders (I was not able to find it) the problem is that size of the chart is less than maxVal.
Yes, this is possible setting Pen visibility to false:

Code: Select all

colorGrid1.Pen.Visible = false;
icecream wrote: I was thinking about drawing a lines (e.g. for last 1000 samples) and update their color using some algorithm.
Ok, you could try accessing line's Colors ValueList to modify colors accordingly.
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