Page 1 of 1

TMyPointSeries - Only with vertical lines?

Posted: Mon Dec 28, 2009 5:16 pm
by 10551564
Hi,

MyPoint series draws a vertical and horizontal line from the axes to each series point.
Is it possible to draw this series only with the vertical lines shown(= hide the horizontal lines)?

Thanks and best regards

Re: TMyPointSeries - Only with vertical lines?

Posted: Tue Dec 29, 2009 3:46 pm
by yeray
Hi Henz,

No, it's not possible right now. I'll add this to the wish list to be implemented in future releases (TV52014610).
In the meanwhile you could do something as following or modify the method procedure TMyPointSeries.DrawValue(ValueIndex:Integer) if you are a source code customer.

Code: Select all

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

  points1:=Chart1.AddSeries(TPointSeries.Create(self)) as TPointSeries;
  points1.FillSampleValues(10);
  points1.OnGetPointerStyle:=OnGetSeriesPointerStyle;
end;

Function TForm1.OnGetSeriesPointerStyle(Sender:TChartSeries; ValueIndex:Integer):TSeriesPointerStyle;
begin
  if ((Sender.XValue[ValueIndex] >= Chart1.Axes.Bottom.Minimum) and (Sender.XValue[ValueIndex] <= Chart1.Axes.Bottom.Maximum)) then
  begin
    Chart1.Canvas.Pen.Color:=clRed;
    Chart1.Canvas.Line(Sender.CalcXPos(ValueIndex),Sender.CalcYPos(ValueIndex),Sender.CalcXPos(ValueIndex),Chart1.Axes.Bottom.PosAxis);
  end;
  result:=psDiamond;
end;