Recent

Author Topic: adding text to line chart points  (Read 799 times)

Firebird

  • New Member
  • *
  • Posts: 26
adding text to line chart points
« on: July 03, 2024, 03:17:32 pm »
Is there a way to "annotate" points in a line chart? I would like to add a string to each point as to "code" these points. In other words I would like to add data points as (x,y,text).

wp

  • Hero Member
  • *****
  • Posts: 12280
Re: adding text to line chart points
« Reply #1 on: July 03, 2024, 04:49:09 pm »
That's what it's made for:
Code: Pascal  [Select][+][-]
  1. Chart1LineSeries.AddXY(x, y, datapt_label, datapt_color);  // title and color optional

In order to display the data point labels, you must switch the series' Marks.Style to smsLabel (if you do this by code you must add unit TAChartUtils). There are other Marks.Style values which select various aspects of a data point - see https://wiki.lazarus.freepascal.org/TAChart_documentation#Mark_labels

Firebird

  • New Member
  • *
  • Posts: 26
Re: adding text to line chart points
« Reply #2 on: July 07, 2024, 06:54:56 pm »
Thanks wp that really helps.

 

TinyPortal © 2005-2018