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...
I use code like this
ShapeOptions1 := TShapeProperties_Create;
ShapeOptions1.Anchor := TClientAnchor.Create(true, TFlxAnchorType.MoveAndResize, 1693, 0, 1251, 0, 1889, 0, 1942, 0);
ShapeOptions1.ShapeType := TShapeType.Rectangle;
ShapeOptions1.ObjectType := TObjectType.MicrosoftOfficeDrawing;
ShapeOptions1.ShapeName := 'TextBox 1';
ShapeOptions1.Text := 'NIMHR346 Sample D6';
ShapeOptions1.TextFlags := 530;
ShapeOptions1.RotateTextWithShape := true;
ShapeOptions1.ShapeThemeFont := TShapeFont_Create(TFontScheme.Minor, TDrawingColor.FromSystem(TSystemColor.WindowText));
ShapeOptions1.Print := true;
ShapeOptions1.Visible := true;
ShapeOptions1.ShapeOptions.SetValue(TShapeOption.wzName, 'TextBox 1');
Chart1.AddAutoShape(ShapeOptions1);