Page 1 of 1

How to avoid overlapping when checking Series-Point-Visible

Posted: Fri Mar 12, 2010 4:52 am
by 8574101
How to avoid overlapping when checking "Series-Point-Visible"?
"Marks" can be drawed every several points by setting the "Series--Marks--Draw every:".
Does "Point" have the any similar setting?

Thanks.

Re: How to avoid overlapping when checking Series-Point-Visible

Posted: Fri Mar 12, 2010 4:57 am
by 8574101
For Example:
1.I add 300 points to Series1.
2.Then I Check the "Series--Point---Visible".
There are so many points that points overlap each other.
So I want to show "Point" every several points to avoid overlapping.

Thanks.

Re: How to avoid overlapping when checking Series-Point-Visible

Posted: Fri Mar 12, 2010 5:05 pm
by yeray
Hi wwp3321,

If I understand well, you have a TLineSeries with pointer visible but too much values to show all that pointers so you would like to hide some of them. Here is how you could do it:

Code: Select all

//...
  private
    { Private declarations }
    function Series1GetPointerStyle(Sender: TChartSeries; ValueIndex: Integer): TSeriesPointerStyle;

//...

uses series;

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

  with Chart1.AddSeries(TLineSeries.Create(self)) as TLineSeries do
  begin
    FillSampleValues(300);
    Pointer.Visible:=true;
    OnGetPointerStyle:=Series1GetPointerStyle;
  end;
end;

function TForm1.Series1GetPointerStyle(Sender: TChartSeries; ValueIndex: Integer): TSeriesPointerStyle;
begin
  if (ValueIndex mod 5 = 0) then Result:=psRectangle
  else Result:=psNothing;
end;

Re: How to avoid overlapping when checking Series-Point-Visible

Posted: Mon Mar 15, 2010 8:20 am
by 8574101
Thank you very much!