Vertical and Horizontal Overflow for Chart Data Labels in PowerPoint Document

Hello,

I would like to have better control over datalabels visibility and placement in case of overflows.
My current problem is funnel data labels placement - labels are place inappropriately when funnel level is too small to fit it.
Studying PowerPoint-authored file I see PPT adds blocks of explicitly formatted text with horizontal/vertical overflow flags. Is it possible to produce similar structures using Aspose Slides?
I see TextVerticalOverflowType enum, but cannot find any examples of using it.

@ygr,
Thank you for posting the question.

Please share the following files:

  • initial PowerPoint presentation with the problem you described
  • presentation created in PowerPoint with the expected chart appearance

Then we will try to help you achieve the result with Aspose.Slides.

I found this solution doesn’t work. After manual datalabel editing, I see it doesn’t appear (as there is no room for it on funnel chart), I save the file. After reopening, I see that label is placed at the wrong place again.

It looks like PPT defect. Do you know any workaround for it?
I attached an example ppt file (bad.zip (29.5 KB)) and image file (bad.png (2.1 KB)) of how PPT renders it (got it through export).

@ygr,
If you open the bad.pptx file in PowerPoint, select the chart, go to Chart Elements, reset Data Labels, and set Data Labels again (ChartElements.png), then the data label will disappear from the chart. And it looks like the data label cannot be displayed in your case. Would you like Aspose.Slides to generate the same chart appearance (without the second data label)?

You can also decrease the font size of the data labels. Then all of them will be visible.

var labels = chart.getChartData().getSeries().get_Item(0).getLabels();
labels.getDefaultDataLabelFormat().getTextFormat().getPortionFormat().setFontHeight(8);

Documents: Chart Data Label