Hello,
currently I am having the issue, that some values overlap each other in my line chart and some of them even overlap the line itself. Any idea how to avoid this? Thanks in advance
Overlap.png (17.9 KB)
Hello,
currently I am having the issue, that some values overlap each other in my line chart and some of them even overlap the line itself. Any idea how to avoid this? Thanks in advance
Overlap.png (17.9 KB)
@ChartsDev,
Thank you for contacting support.
Please check your results using the latest version of Aspose.Slides if it is possible. If the issue persists, please share the following data and information:
Hello,
thank you for your reply and sorry that it took me so long to respond. I have prepared a demo project which creates a line chart showing the mentioned issue. I am using Aspose.Slides version 22.12.0 with the .NET target platform 472 on Windows. Attached, you can find the demo project.
Thank you for your time.
AsposeChart.zip (6.1 KB)
@ChartsDev,
Unfortunately, there does not seem to be a setting in PowerPoint documents automatically forces chart data labels to show without overlapping. You can reduce the font size of the chart data labels to avoid this problem like this:
series.Labels.DefaultDataLabelFormat.TextFormat.PortionFormat.FontHeight = 10;
Result: example.png (23.0 KB)
Documents: Chart Data Label
Thank you again for your response. Is this a known issue? Is it maybe going to be solved in the future?
@ChartsDev,
PowerPoint charts only allow you to change the position of chart data labels to Center, Left, Right, Above, and Below of the point. FormatDataLabels.png (8.3 KB). With Aspose.Slides, you can achieve the same like this:
series.Labels.DefaultDataLabelFormat.Position = LegendDataLabelPosition.Top;
There are no settings to avoid the label overlapping, but you can try to get the best label placement by positioning some of the data labels (even or odd, for example) individually, as shown below:
series.Labels[index].DataLabelFormat.Position = LegendDataLabelPosition.Bottom;
Thanks again, we will try to get the best result with the code you have shown.