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,
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,
- 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)
Thanks - that’s solved my current issues.
Hi,