How to hide lines and show markers in LineChart?

In Excel, when creating a line chart,
11111111.jpg (81.8 KB)

we can add markers and hide lines

22222.jpg (15.9 KB)

22222.jpg (15.9 KB)

and after that the chart looks like this

444444.jpg (65.1 KB)

However I don’t know how to achieve this by API in Aspose.Cells, anyone can help?

Hi,

Thanks for the screenshots.

See the sample code segment on how to hide series lines and set series markers for your reference. The same attributes would be used if you need to hide data points (ChartPoint) lines and its markers:
e.g
Sample code:

Series series = chart.NSeries[0];
//Set Series's markers and hide its line. 
series.Border.IsVisible = false;
series.Marker.MarkerStyle = ChartMarkerType.Circle;
series.Marker.MarkerSize = 6;

Hope, this helps a bit.

Thank you.

Thank you!

Well, series.Border.IsVisible = false did hide the line but the following two lines of code still doesn’t show marker unless
I explicitly set chart.NSeries[idx].Marker.Border.IsVisible = true.

Also I need to fill the marker so I add one more line as shown below

chart.NSeries[idx].Marker.Area.FillFormat.FillType = FillType.Solid;

Thank you again for the support, I have my problem solved.

@mchen11

Thanks for your feedback and using Aspose.Cells.

It is good to know that you were able to sort out your issue. Let us know if you encounter any other problem, we will be glad to look into it and help you further.