Page 1 of 1

Waveform

Posted: Thu Aug 05, 2010 3:19 pm
by 10055200
Hi,

I am using TChart and TFastLineSeries. I usually show up to 1024 data on chart. But I have in memory up to 8MB of data. I disabled ShowAllPoints but then idea about waveform type of display crossed my mine. I would like to show that 8MB of data at same time. If I do that computer performances drops which is logical. So Idea is to show 1024 points from that 8MB but in a way like waveform in musical programs is displayed.

Like here: Image

1. Is there any tool for TeeChart to do that. I was thinking about region tool?
2. What if I take two series (on inverted regarding other) is it possible to paint between that two series to recreate effect of waveform?

Thanks
Best regards.

Re: Waveform

Posted: Fri Aug 06, 2010 1:23 pm
by yeray
Hi Polabs,

If you can draw it in four series, it wouldn't be difficult to use, as you say, TSeriesBandTool:

Code: Select all

uses Series, TeeSeriesBandTool;

procedure TForm1.FormCreate(Sender: TObject);
var i, j: Integer;
begin
  Chart1.View3D:=false;

  for i:=0 to 3 do
  begin
    with Chart1.AddSeries(TLineSeries) do
    begin
      Add(i*100);
      for j:=1 to 499 do
        Add(YValue[j-1] + Random -0.5);
    end;
  end;

  with Chart1.Tools.Add(TSeriesBandTool) as TSeriesBandTool do
  begin
    Series:=Chart1[0];
    Series2:=Chart1[3];
    Brush.BackColor:=RGB(77, 61, 220);
    Series.Color:=Brush.BackColor;
    Series2.Color:=Brush.BackColor;
  end;

  with Chart1.Tools.Add(TSeriesBandTool) as TSeriesBandTool do
  begin
    Series:=Chart1[1];
    Series2:=Chart1[2];
    Brush.BackColor:=RGB(150, 150, 237);
    Series.Color:=Brush.BackColor;
    Series2.Color:=Brush.BackColor;
  end;
end;
chart1.png
chart1.png (8.19 KiB) Viewed 3772 times

Re: Waveform

Posted: Fri Aug 06, 2010 2:30 pm
by 10055200
Yes this is what I am looking for.

Thank you very much! Your support ROCKS! :wink: