Frequently Asked Component Specific Questions

Options

Display all FAQ items

Search FAQ items:


Displaying items 1 to 1 of 1, page 1 of 1

<< previous next >>

TMS VCL Chart
Adding and removing annotations

Start the AnnotationEditorDialog and click on the- sign to remove or the + sign to add an annotation. You can add multiple annotations per series. Here is an example to remove an annotation and to add an annotation to the first series of the first pane.
procedure TForm1.AddNewAnnotation; 
var 
  ca: TChartAnnotation; 
begin 
  ca := AdvChartView.Panes[0].Series[0].Annotations.Add; 
  // set properties of the chart annotation here 
end; 

procedure TForm1.RemoveAnnotation; 
begin 
  AdvChartView.Panes[0].Series[0].Annotations[0].Free; 
end;
Note: for pane, serie and annotation adding create use the following code to set properties.
Example with annotations:
procedure TForm1.AddNewAnnotation; 
begin 
  with AdvChartView.Panes[0].Series[0].Annotations.Add do 
  begin 
    // ADD ALL CODE TO SET PROPERTIES HERE EXAMPLE: 
    Shape := asBalloon; 
  end; 
end;
There are different kinds of annotations that can be used to mark special points of interest in a series.

Balloon, Circle, RoundRectangle, Rectangle : Shapes to wrap around the text.
Line: a line drawn from top to bottom on the X-position of the point.

Offset (X, Y): the text offset from the X, Y- position of the point.
Here is a screenshot with the different shapes.