TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
-
Rodrigue
- Newbie
- Posts: 23
- Joined: Fri Jan 28, 2005 5:00 am
- Location: Belgium
Post
by Rodrigue » Mon Jul 11, 2005 11:30 am
Hello,
I would like to be able to display each line segment of a series with a color proportionnal (example : gray intensity) to a value stored in a matrix. I try to use "Each color" but when I do it, outline doesn't work !
I've seen this post :
http://www.teechart.net/support/modules ... 3da1d217cb
so, I try :
Code: Select all
if(ValueIndex%2 == 0)
{
Sender->Pen->Width = 5;
//return psRectangle;
}
else
{
Sender->Pen->Width = 1;
//return psTriangle;
}
return psSmallDot
Is ValueIndex the index of my matrix : 0 => Point0, 1=> Point1, etc. ?
With this method outline doesn't work !
Help me, please...
Cordially,
Rodrigue
-
Narcís
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
-
Contact:
Post
by Narcís » Mon Jul 11, 2005 2:43 pm
Hi Rodrigue,
Is ValueIndex the index of my matrix : 0 => Point0, 1=> Point1, etc. ?
ValueIndex is the series points index. It goes from 0 to Series.Count-1.
Which series type are you using? What are you exactly trying to achieve? Depending on which series are you using you can use
Pen and
Brush properties or if you are using line series you'd better use
LinePen and
Outline. To change series pointer size you should use
Sender.Pointer.HorizSize and
Sender.Pointer.VertSize.
-
Rodrigue
- Newbie
- Posts: 23
- Joined: Fri Jan 28, 2005 5:00 am
- Location: Belgium
Post
by Rodrigue » Mon Jul 11, 2005 5:54 pm
Hello,
Thanks for your quick reply.
I would like to do that (sorry it's a draft) :
If you don't see it on the forum, you could go directly to :
http://www.rodsoft.be/gradient_serie.gif
I have Matrix who contains X and Y coordonite. For each coordinate, I've computed a color that I want to display on the graphic. There will be several series so, I would like to differentiate her by their outline.
I use a TLineSeries.
TIA.
Cordially,
Rodrigue
-
Narcís
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
-
Contact:
Post
by Narcís » Tue Jul 12, 2005 10:39 am
Hi Rodrigue,
To achieve something like what you request you can use something similar to:
Code: Select all
procedure TForm1.FormCreate(Sender: TObject);
var
i: integer;
begin
Chart1.View3D:=true;
With Series1 do
begin
LinePen.Width:=2;
LinePen.Color := clWhite;
ColorEachPoint:=true;
With Outline do
begin
Visible:=true;
Width:=1;
Color:=clYellow;
end;
for i:=0 to 25 do Add(random(100),'',RGB(255,255 - (i * 10),i * 10));
end;
end;
-
Rodrigue
- Newbie
- Posts: 23
- Joined: Fri Jan 28, 2005 5:00 am
- Location: Belgium
Post
by Rodrigue » Tue Jul 19, 2005 11:34 am
Thank your very much!
Is it normal that outline and LinePen doesn't work if View3D is set to false ?
Cordially,
Rodrigue
-
Pep
- Site Admin
- Posts: 3299
- Joined: Fri Nov 14, 2003 5:00 am
-
Contact:
Post
by Pep » Fri Jul 22, 2005 9:17 am
Hi Rogrigue,
when view3D is set to false LinePen does the same as Pen property. The Outline can be used in 2D and 3D. Using the following code works fine in 2D :
Code: Select all
Chart1.View3D := false;
Series1.FillSampleValues(10);
series1.OutLine.Color := clgreen;
series1.OutLine.Visible := true;
series1.OutLine.Width :=2;