当前位置: 动力学知识库 > 问答 > 编程问答 >

c# - Persistence mode in TeeChart

问题描述:

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.

Thanks.

P.S.: I use .NET library of TeeChart.

网友答案:

This has already been answered at Steema Software's public forums. For the sake of completeness, I'll copy the answer here as well.

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:

  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.

分享给朋友:
您可能感兴趣的文章:
随机阅读: