Add Tcolorline in Code vs GUI

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
sunman4008
Newbie
Newbie
Posts: 18
Joined: Tue Apr 09, 2013 12:00 am

Add Tcolorline in Code vs GUI

Post by sunman4008 » Mon Feb 24, 2014 10:07 pm

Hello,

How do I add a TColorLine in the GUI compared to the GUI? I want to be able to add X number of ColorLine which varies depending on the situation. Right, I can double click on the Tchart GUI and add them through the gui. How do I do that through code?

-Mike

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

Re: Add Tcolorline in Code vs GUI

Post by Yeray » Tue Feb 25, 2014 3:41 pm

Hi Mike,
sunman4008 wrote: How do I do that through code?
Here you have a simple example:

Code: Select all

uses Series, TeeTools;

procedure TForm1.FormCreate(Sender: TObject);
begin
  Chart1.View3D:=false;

  Chart1.AddSeries(TPointSeries).FillSampleValues;

  with Chart1.Tools.Add(TColorLineTool) as TColorLineTool do
  begin
    Axis:=Chart1.Axes.Left;
    Value:=Chart1[0].YValues.MaxValue*2/3;
    Pen.Color:=clRed;
  end;
end;
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

Post Reply