Override TBarSeries

Override TBarSeries

Post by iinlan » Thu, 14 Dec 2006 21:30:11


Hi!
I need custom TBarSeries class, I want to add error margin to each
bar.
As I understood I have to override DrawBar function to do this. I run
into problem when I tried to draw on the bar, I can not see any visual
changes. How Should I do this?

type
TMyBarSeries = class(TBarSeries)
public
procedure DrawBar(BarIndex, StartPos, EndPos: Integer); override;
end;

{ TMyBarSeries }

procedure TMyBarSeries.DrawBar(BarIndex, StartPos, EndPos: Integer);
var
y:integer;
begin
inherited;
y := CalcYPos(BarIndex);
ParentChart.Canvas.MoveTo(StartPos, y -10);
ParentChart.Canvas.LineTo(StartPos, y +20);
end;