Page 1 of 1

Persistence mode

Posted: Thu Feb 05, 2015 6:37 pm
by 13049883
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.

Re: Persistence mode

Posted: Fri Feb 06, 2015 3:11 pm
by narcis
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.

Re: Persistence mode

Posted: Fri Feb 06, 2015 5:51 pm
by 13049883
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.

Re: Persistence mode

Posted: Mon Feb 09, 2015 9:03 am
by narcis
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.