Multiple charts on one graph

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
Stewie
Newbie
Newbie
Posts: 7
Joined: Fri Nov 15, 2002 12:00 am
Location: UK

Multiple charts on one graph

Post by Stewie » Thu Jun 03, 2004 11:41 am

Hi I am trying to get a number of graphs on the same page - I can either do this using custom axis or could have multiple TCharts on the same panel separated by splitters.

Using the second approach I have seen how to force each chart to change its display when one of the other charts is scrolled, but my problem with this approach is that the labels on each chart axis are different sizes so the charts do not line up correctly.

What I'm trying to do is have some OHLC data plus an indicator series and a volume series. I like the way you have these setup in your OHLC chart examples - do you have example source for how you achieved that particular look ? I'm using BCB6 and TeeChart 5 at the moment. Would I gain anything by upgrading to version 7 ?

I'm interested in being able to switch off the display of the indicators and or volume charts very easily.

Thanks Stew.

Pep
Site Admin
Site Admin
Posts: 3303
Joined: Fri Nov 14, 2003 5:00 am
Contact:

Post by Pep » Thu Jun 03, 2004 2:38 pm

Hi Stew,
and a volume series. I like the way you have these setup in your OHLC chart examples - do you have example source for how you achieved that particular look ?
Which example are you referencing ? You can find the sources of the Demo Features project under :
c:\Program Files\Steema Software\TeeChart Pro v7 for BCB6/Examples/Features.
I'm using BCB6 and TeeChart 5 at the moment. Would I gain anything by upgrading to version 7 ?
Yes, a lot of more features, improved the speed,... I suggest you download the TeeChart Pro v7 Trial and test it.


Another way to align some Charts is using similar code to the following :

Code: Select all

procedure TAlignChartsForm.RadioGroup1Click(Sender: TObject);
begin
 if RadioGroup1.ItemIndex=0 then
 begin
   Chart1.LeftAxis.LabelsSize:=40;
   Chart2.LeftAxis.LabelsSize:=40;
   Chart1.LeftAxis.TitleSize:=20;
   Chart2.LeftAxis.TitleSize:=20;
 end
 else { automatic axis size }
 begin
   Chart1.LeftAxis.LabelsSize:=0;
   Chart2.LeftAxis.LabelsSize:=0;
   Chart1.LeftAxis.TitleSize:=0;
   Chart2.LeftAxis.TitleSize:=0;
 end;
end;

procedure TAlignChartsForm.FormCreate(Sender: TObject);
begin
  { random values and titles }
  Series1.FillSampleValues(100);
  Series2.FillSampleValues(100);
  Chart1.LeftAxis.Title.Caption:='Chart One';
  Chart2.LeftAxis.Title.Caption:='Chart Two';

  { force alignment... }
  RadioGroup1Click(Self);
end;

Stewie
Newbie
Newbie
Posts: 7
Joined: Fri Nov 15, 2002 12:00 am
Location: UK

Post by Stewie » Thu Jun 03, 2004 2:58 pm

Josep

Thanks for that, will give the V7 trial a look, can it co-exist with V5 ok or do I need to remove V5 first ?

Cheers

Stew

Pep
Site Admin
Site Admin
Posts: 3303
Joined: Fri Nov 14, 2003 5:00 am
Contact:

Post by Pep » Thu Jun 03, 2004 4:07 pm

Hi Stew,

you must remove the v5 before to install the v7.

Post Reply