Hello,
in TCustomSeries.DrawPointer:
OnGetPointerStyle function determines pointer style. But, it is possible to do more. For example, pointer.color,..
//I want to change both color and pointer.style
function Tfrm_graph.SeriesGetPointerStyle(Sender: TChartSeries;
ValueIndex: Integer): TSeriesPointerStyle;
begin
if odd(ValueIndex) then
begin
result:=psCircle ;
sender.pointer.color:=clred;
end
else
begin
sender.pointer.color:=clblue;
result:=psCircle;
end;
end;
I changed in series.pas as below:
Procedure TCustomSeries.DrawPointer(AX,AY:Integer; AColor:TColor; ValueIndex:Integer);
var tmpStyle : TSeriesPointerStyle;
begin
if Assigned(FOnGetPointerStyle) then tmpStyle:=FOnGetPointerStyle(Self,ValueIndex)
else tmpStyle:=Pointer.Style;
Pointer.PrepareCanvas(ParentChart.Canvas,AColor);
Pointer.Draw(AX,AY,AColor,tmpStyle);
end;
PrepareCanvas should called after OnGetPointerStyle function
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hello fnn,
Thanks for the suggestion, we changed this for v8, which is the version we are currently working with. The change is in Series.pas:
If you are interested in beta-testing v8 please read this.
Thanks for the suggestion, we changed this for v8, which is the version we are currently working with. The change is in Series.pas:
Code: Select all
Procedure TCustomSeries.DrawPointer(AX,AY:Integer; AColor:TColor; ValueIndex:Integer); var tmpStyle : TSeriesPointerStyle; begin
// Set canvas properties to Pointer (Brush, Color, Pen)
Pointer.PrepareCanvas(ParentChart.Canvas,AColor);
// Call the OnGetPointerStyle event if assigned.
tmpStyle:=DoGetPointerStyle(ValueIndex);
// Repeat again setting Canvas parameters, thus allowing the developer
// to use the OnGetPointerStyle event to modify other Pointer properties
// like Color, Pen, etc.
if Assigned(FOnGetPointerStyle) then
Pointer.PrepareCanvas(ParentChart.Canvas,AColor);
Pointer.Draw(AX,AY,AColor,tmpStyle);
end;
Best Regards,
Narcís Calvet / Development & Support Steema Software Avinguda Montilivi 33, 17003 Girona, Catalonia Tel: 34 972 218 797 http://www.steema.com |
Instructions - How to post in this forum |