We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Marker formatting / styling in Excel Charts using Aspose.Cells for Java

Hi Team,

we are trying to render a LINE chart in excel through aspose cells.
We have already implemented LINE chart in PPT through aspose slides.

below is sample code snippet on how we set some formatting/styling for the markers in line chart

IMarker marker;

marker.getFormat().getFill().getSolidFillColor().setColor(some color);
marker.getFormat().getLine().getFillFormat().getSolidFillColor().setColor(some color);

Could you please help me to achieve the same marker formatting through aspose cells API ?


See the sample code segment for your reference:
Sample code:

Series series = chart.getNSeries().get(0);

//Set the series line color

//Specify series marker attributes
Marker marker = series.getMarker();
marker.setMarkerStyle(ChartMarkerType.CIRCLE);//marker style            
marker.setMarkerSize(10);//set size
marker.getArea().setForegroundColor(com.aspose.cells.Color.getGreen());//fill color
marker.getBorder().setColor(com.aspose.cells.Color.getRed());//line color

Hope, this helps a bit.

Please note, Aspose.Cells and Aspose.Slides are two diverse APIs, both have their own architectures with different types. You should not expect one object of an API is equivalent/same to other one. You have to write the code accordingly. For example, if you are creating charts in MS Excel spreadsheet via Aspose.Cells API, you will go through Chart relevant APIs and use in your code. These APIs might not have similarities with charts APIs of Aspose.Slides for Java.

Thanks for the quick reply @Amjad_Sahi

So there is no marker line FillType separately as we have in aspose.slides ?


Yes, please try to refer to the code segment (above) and write your own code using Aspose.Cells for Java API.

Thanks @Amjad_Sahi.

You are welcome.