In the documentation it says that for Chart.AddAutoShape I should create a simple file in Excel and use APIMate. I tried this with a simple embedded chart, and a single rectangle placed on the chart. API mate produces code a perfect chart, but no mention of the shape.
Since the document defers to APIMate and APImate does not do it there is no good example.
I have tried this without help, and unfortunately I get an Exception when I try to add the Autoshape...
In case it is useful I have traced the exception through into the Flexcel code. I know the line it is occuring (see below), but not sure what is causing the relevant object to be returning nil
In _UXlsSheet.TFlxChart
Procedure TFlxChart.AddAutoShape()....
This behaviour seems to only occur when I am creating an embedded chart using the API first. If I try this on a chart sheet when loading an existing file it works fine with no exception
I am going to have to try creating a different template with an embedded chart, and slightly modify my code that adds to the template graph... I will report back later.
Indeed, when adding a chart with the API, a value wouldn't be set which would later cause AddAutoshape to crash. This was fixed and the fix will be available in 7.10
@adrian . Just working on a presentation for the UK developers group next week about Flexcel and some of the more advanced features. This is one of the things I issue above is one I have been wanting to do for a while. I started working on the examples in 7.09 but have just had a chance to update to 7.10.
I can confirm that APImate does now produce code for my text annotations on graphs, and it does handle font changes (color, superscript, etc). Exceuting the code from APImate gives me very close to perfect results. I am really happy to see this and will be showing it in the presentation.
It looks like there are a few minor differences (around margins of the text box), but nothing that will stop me for now.