Page 1 of 1

Each line segment of a series : different color + outline

Posted: Mon Jul 11, 2005 11:30 am
by 9340780
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

Posted: Mon Jul 11, 2005 2:43 pm
by narcis
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.

Posted: Mon Jul 11, 2005 5:54 pm
by 9340780
Hello,

Thanks for your quick reply.

I would like to do that (sorry it's a draft) :
Image
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

Posted: Tue Jul 12, 2005 10:39 am
by narcis
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;

Posted: Tue Jul 19, 2005 11:34 am
by 9340780
Thank your very much!

Is it normal that outline and LinePen doesn't work if View3D is set to false ?

Cordially,
Rodrigue

Posted: Fri Jul 22, 2005 9:17 am
by Pep
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;