I created a chart (dynamically at runtime) and added some series ... not problem so far. Now I need to add a kind of lable to some of the series. The lable shoulb be displayed within the chart so I looked around and found the TAnnotationTool. That should do what I want and should be easy to use. Here is what I did:
Code: Select all
TAnnotationTool* annotation = new TAnnotationTool(pChart);
annotation->Shape->CustomPosition = true;
annotation->Shape->Left = 65;
annotation->Shape->Top = 125;
annotation->Text = "Annotation 1";
The code copiles fine, but when I run the application I get a Runtime error "Access violation at address 4207A0B in Module 'Tee710.bpl'. Read of address 00000000.". If I stop in the debugger I can not see that there is anything wrong with the annotation object. But obviously I'm missing something.
Can anyone help with that, pls? Or is there another solution to add a text lable to the chart?
Thx