Hi,
The code generated by APIMate is wrong in this case: You don't have to add the image to the chart sheet, but to the chart inside the chart sheet.
The code should really be:
//Images
fs := TFileStream.Create('imagename.png', fmOpenRead or fmShareDenyNone);
try
ImgProps := TImageProperties_Create();
ImgProps.Anchor := TClientAnchor.Create(true, TFlxAnchorType.MoveAndResize, 618, 0, 1018, 0, 2323, 0, 1663, 0);
ImgProps.ShapeName := 'Picture 2';
var chart := xls.GetChart(1, '');
chart.AddImage(fs, ImgProps);
finally
fs.Free;
end;
but... this won't compile because there is no AddImage in IXlsChart. There is AddAutoshape but not AddImage, and this is just something we forgot. There should be a method to add an image to a chart, and we will be adding one for the next version (and fixing APIMate so it enters the image in the right place)