Java - Chart line formatting

We’re using Aspose Cells 7.3.3, and trying to change the appearance of the lines on a bar chart. The code, which I based on the examples in the Programmer’s Guide, is:



Series series = (Series) it.next();

series.setName("=GraphData!A" + r++);

series.getArea().setForegroundColor(colours[c]);

series.setMarkerStyle(ChartMarkerType.NONE);

series.setMarkerSize(3);

series.getLine().setColor(colours[c]);

series.getLine().setWeight(WeightType.MEDIUM_LINE);



But the markers are still appearing. I notice that several of these methods are marked as deprecated, but the online API doesn’t seem to indicate an alternative.



Please could you suggest the correct approach.



Thanks,

Martin

Hi,


Please see the topic for reference:


If you still find any issue, kindly give us your template file (input and output) and complete code, we will check your issue soon.

Also, now we have released our next official version v7.3.4, so we recommend you to try it:
http://www.aspose.com/community/files/72/java-components/aspose.cells-for-java/entry427314.aspx

Thank you.

I’ve updated to Aspose Cells 7.3.4, but that hasn’t changed this situation. The code I included in my original post was mostly copied from the Setting Charts Appearance page you mention.



I tried to remove the markers with series.setMarkerStyle(ChartMarkerType.NONE);

but that doesn’t seem to work. However they don’t appear unless I set the foreground colour with

series.getArea().setForegroundColor(colours[c]);



Series.getLine(), Series.setMarkerSize() and series.setMarkerStyle() are all marked as deprecated - what should be used instead of these methods?

Hi,


Please note the replacements for the deprecated APIs in the new versions and you may change/update your codes accordingly:
e.g

  • Series.getLine() —> Series.getBorder() (It will return the Line object so, please use the members of the Line)
  • Series.setMarkerSize()/getMarkerSize() —> Series.getMarker().setMarkerSize()/Series.getMarker().getMarkerSize() (Series.getMarker() will return Marker object, check the members of it)
  • Series.setMarkerStyle()/getMarkerStyle() —> Series.getMarker().setMarkerStyle()/Series.getMarker().getMarkerStyle() (Series.getMarker() will return Marker object, check the members of the class)

Let us know if you still have any confusion, we will be happy to assist you further.

Thank you.

Thanks - that’s solved my current issues.

Hi,


Good to know that your issue regarding using newer APIs is resolved now.

Feel free to contact us any time if you need further help or have some issues.

Thank you.