Hi Arpit,
Hi Babar,
Hi,
Thanks for your posting and using Aspose.Cells.
Kindly provide the Excel file which is inside the abc.ppt file and also provide the fixed Excel file which has been fixed by opening and editing in Microsoft Excel.
Please also provide the sample code which you are using to create this chart so that we could run your code and investigate this issue further.
Hi,
Hi Arpit,
Thanks for your posting and using Aspose.Cells.
Please use the Chart.getNSeries().get(i).getMarker() property to change the marker style of the entire series. It will then match your Series and Legend marker symbols fine.
Please see the following sample code. The code sets the marker style of all series to circle and red color. I have attached the source Excel file used in this code and the output Excel file generated by it and the screenshot showing the output of the code for your reference.
Java
String filePath = “F:\Shak-Data-RW\Downloads\source.xlsx”;
Workbook workbook = new Workbook(filePath);
Worksheet worksheet = workbook.getWorksheets().get(0);
Chart chart = worksheet.getCharts().get(0);
for (int i = 0; i < chart.getNSeries().getCount(); i++)
{
Marker marker = chart.getNSeries().get(i).getMarker();
marker.setMarkerStyle(ChartMarkerType.CIRCLE);
marker.getArea().getFillFormat().setType(FillType.SOLID);
marker.getArea().getFillFormat().getSolidFill().setColor(Color.getRed());
}
workbook.save(“output.xlsx”);
Thank you so much…Its working!
Hi Arpit,
Hi Shakeel,
{
Marker marker = chart.getNSeries().get(i).getMarker();
marker.setMarkerStyle(ChartMarkerType.AUTOMATIC);
marker.getArea().getFillFormat().setType(FillType.SOLID);
marker.getArea().getFillFormat().getSolidFill().setColor(Color.getRed());
}
Hi Arpit,
Workbook workbook = new Workbook(“D:/temp/source.xlsx”);
Worksheet worksheet = workbook.getWorksheets().get(0);
Chart chart = worksheet.getCharts().get(0);
Marker marker = chart.getNSeries().get(0).getMarker();
marker.setMarkerStyle(ChartMarkerType.CIRCLE);
marker.getArea().getFillFormat().setType(FillType.SOLID);
marker.getArea().getFillFormat().getSolidFill().setColor(Color.getRed());
marker = chart.getNSeries().get(1).getMarker();
marker.setMarkerStyle(ChartMarkerType.SQUARE_STAR);
marker.getArea().getFillFormat().setType(FillType.SOLID);
marker.getArea().getFillFormat().getSolidFill().setColor(Color.getBlue());
marker = chart.getNSeries().get(2).getMarker();
marker.setMarkerStyle(ChartMarkerType.DIAMOND);
marker.getArea().getFillFormat().setType(FillType.SOLID);
marker.getArea().getFillFormat().getSolidFill().setColor(Color.getYellow());
marker = chart.getNSeries().get(3).getMarker();
marker.setMarkerStyle(ChartMarkerType.SQUARE_X);
marker.getArea().getFillFormat().setType(FillType.SOLID);
marker.getArea().getFillFormat().getSolidFill().setColor(Color.getGreen());
marker = chart.getNSeries().get(4).getMarker();
marker.setMarkerStyle(ChartMarkerType.SQUARE_PLUS);
marker.getArea().getFillFormat().setType(FillType.SOLID);
marker.getArea().getFillFormat().getSolidFill().setColor(Color.getMagenta());
marker = chart.getNSeries().get(5).getMarker();
marker.setMarkerStyle(ChartMarkerType.TRIANGLE);
marker.getArea().getFillFormat().setType(FillType.SOLID);
marker.getArea().getFillFormat().getSolidFill().setColor(Color.getViolet());
/
for (int i = 0; i < chart.getNSeries().getCount(); i++)
{
Marker marker = chart.getNSeries().get(i).getMarker();
// marker.setMarkerStyle(ChartMarkerType.CIRCLE);
marker.setMarkerStyle(ChartMarkerType.AUTOMATIC);
marker.getArea().getFillFormat().setType(FillType.SOLID);
marker.getArea().getFillFormat().getSolidFill().setColor(Color.getRed());
}
/
workbook.save(“D:/output.xlsx”);