Aspose.word.dll Chart formatting issue

Hi Aspose team,

I want to generate chart as shown in below picture, Can you please help on this.

I am able to generate bellow chart but not able to add images on MajorGridLines

@Amol_Hekade

To add images on the MajorGridLines of a chart using Aspose.Words, you will need to customize the chart’s gridlines and overlay images at the desired positions. Unfortunately, the provided context does not contain specific examples or methods for directly placing images on gridlines.

However, you can achieve a similar effect by following these general steps:

  1. Create the Chart: Start by creating your chart using the DocumentBuilder and insert the desired chart type.

  2. Customize the Gridlines: You can hide the default major gridlines if necessary, and then manually draw or insert images at the positions where the gridlines would typically appear.

  3. Insert Images: Use the DocumentBuilder.InsertImage method to place images at the calculated positions of the gridlines. You will need to determine the coordinates based on the chart’s dimensions and the data points.

Here is a basic example of how you might set up a chart and insert images:

Document doc = new Document();
DocumentBuilder builder = new DocumentBuilder(doc);

// Insert a chart
Shape chartShape = builder.insertChart(ChartType.COLUMN, 500.0, 300.0);
Chart chart = chartShape.getChart();

// Clear default series and add your own
chart.getSeries().clear();
chart.getSeries().add("Series 1", new String[] { "Category 1", "Category 2" }, new double[] { 1.0, 2.0 });

// Hide major gridlines if needed
for (ChartAxis axis : chart.getAxes()) {
    if (axis.getType() == ChartAxisType.VALUE) {
        axis.hasMajorGridlines(false);
    }
}

// Insert images at specific positions (you will need to calculate these)
builder.insertImage("path/to/image.png", 100, 100, 50, 50); // Example coordinates
builder.insertImage("path/to/image2.png", 200, 100, 50, 50); // Example coordinates

doc.save("output.docx");

In this example, you would need to adjust the coordinates (100, 100) and (200, 100) to match the positions of your gridlines based on the chart’s layout.

For more detailed customization, you may need to explore the Aspose.Words documentation or community forums for specific techniques related to your chart type and layout requirements.

@Amol_Hekade Unfortunately, there is no way to add images on the chart using Aspose.Words.

We have opened the following new ticket(s) in our internal issue tracking system and will deliver their fixes according to the terms mentioned in Free Support Policies.

Issue ID(s): WORDSNET-18287

You can obtain Paid Support Services if you need support on a priority basis, along with the direct access to our Paid Support management team.

Currently you can only place floating images on top of the chart shape.