Waveform

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
PoLabs
Newbie
Newbie
Posts: 35
Joined: Fri Feb 05, 2010 12:00 am

Waveform

Post by PoLabs » Thu Aug 05, 2010 3:19 pm

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.

Yeray
Site Admin
Site Admin
Posts: 9612
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: Waveform

Post by Yeray » Fri Aug 06, 2010 1:23 pm

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 3770 times
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

PoLabs
Newbie
Newbie
Posts: 35
Joined: Fri Feb 05, 2010 12:00 am

Re: Waveform

Post by PoLabs » Fri Aug 06, 2010 2:30 pm

Yes this is what I am looking for.

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

Post Reply