Hi @all,
I wrote a little app for drawing charts. That is something new, isn't it?
I am adding and editing series at runtime. Today I was gone for implementing the rendering over BGRA.
In order to get runtime-created TBarSeries rendered as ChocolateBar, I need to assign an event-handler, and that is the step where I got stuck.
procedure TfrmMain.AddSeries;
var
ser: TBasicChartSeries;
..
begin
...
if ser is TBarSeries then
begin
//this code gets executed
TBarSeries(ser).OnBeforeDrawBar := @BeforeDrawBarHandler;
end;
Chart.AddSeries(ser);
....
procedure TfrmMain.BeforeDrawBarHandler(ASender: TBarSeries;
ACanvas: TCanvas; const ARect: TRect; APointIndex, AStackIndex: integer;
var ADoDefaultDrawing: boolean);
begin
//this code never execute
ADoDefaultDrawing := False;
DrawChocolateBar(ASender, ACanvas, ARect, APointIndex, True);
end;
Any idea what I am doing wrong?
The app is based on the demos for TAChart with the addition of saving the whole work to file, copy the graph to the clipboard.
Screenshot is attached (just an example without much sense)
If the app gets usable, I will be glad to share it here.