If I understand correctly you want to add markers to the chart to identify events which happened during data aquisition. As markers you want to add vertical constant lines.
A TConstantLine series is added like any other series at runtime: Create it, set its properties, then add it to the chart by calling AddSeries (http://wiki.lazarus.freepascal.org/TAChart_Runtime_FAQ#How_to_add_a_series_at_runtime.3F):
uses TASeries; procedure TForm1.AddLineMarker(x: Double); var line: TConstantLine; begin line := TConstantLine.Create(self); line.Position := x; line.LineStyle := lsVertical; line.Pen.Color := clRed; Chart1.AddSeries(line); end;
Alternatively you can assign some message text to the datapoint at which the event happened. The message text can be displayed as a label at the corresponding data point:
uses TACustomSource, TACustomSeries, TAChartUtils; procedure TForm1.AddMarkerText(ASeries: TChartSeries; AIndex: Integer; AText: String); // Index is the data point index which will get the label var item: PChartDataItem; begin item := ASeries.Source[AIndex]; item^.Text := AText; ASeries.Marks.Style := smsLabel; end;
In the attachment you can find a working demo which illustrates the principle.