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.
How to place a mark on a single data point
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:
2) You can use the Annotation Callout Tool. Please, take a look at the vcl demo: All Features -> Tools -> Annotation -> Annotation Callout
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;
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |