How to place a mark on a single data point

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
keith
Newbie
Newbie
Posts: 7
Joined: Thu Sep 05, 2002 4:00 am

How to place a mark on a single data point

Post by keith » Thu Feb 01, 2007 6:47 am

I have an line series and have already placed data points using

Series1->AddXY(xdata[istart+k],ydata[istart+k],"",clGreen);

filled from xdata and ydata arrays, while varying istart and k.

Later I need to mark a specific point with a label.

What is the C++ syntax to display a label, only on a specific point, and to set the background color, and the font color, of the label mark.

Yeray
Site Admin
Site Admin
Posts: 9615
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Post by Yeray » Fri Feb 02, 2007 9:17 am

Hello keith,

We think you have two ways to display your custom labels:

1) You can use the series' event "OnGetMarkText" to show the labels you choose. In the following example, in a Bar series, we show the third bar's label and modify its font size to 20:

Code: Select all

procedure TForm1.Series1GetMarkText(Sender: TChartSeries; ValueIndex: Integer; var MarkText: String);
begin
     if ValueIndex<>2 then
        MarkText:='';

     Series1.Marks.Item[2].Font.Size := 20;
end;
2) You can use the Annotation Callout Tool. Please, take a look at the vcl demo: All Features -> Tools -> Annotation -> Annotation Callout
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

Post Reply