gitbrent / PptxGenJS

Create PowerPoint presentations with a powerful, concise JavaScript API.
https://gitbrent.github.io/PptxGenJS/
MIT License
3.01k stars 645 forks source link

dataLabelPosition option for Pie charts #837

Closed kornarakis closed 3 years ago

kornarakis commented 4 years ago

Category

Version

Please specify what version of the library you are using: [ 3.3.1 ]

Please specify what version(s) of PowerPoint you are targeting: [ 360 ]

Expected / Desired Behavior / Question

When creating a Pie to have the dataLabelPosition option available like Powerpoint has, so we can position the labels for example outside the pie with outEnd.

gitbrent commented 4 years ago

The Chart API docs show this as an option for bar charts, but it should work with pie charts according to what i see in the source code.

https://github.com/gitbrent/PptxGenJS/blob/506af72a7a0e2d8694ca012d374521d7d1c7de6c/src/gen-charts.ts#L1457

veredmly commented 4 years ago

The 'outEnd' option is not working for pie chart.

calidatkoch commented 4 years ago

@gitbrent The line you mentioned has no effect. To work properly it should be replaced with: strXml += "<c:dLblPos val=\"" + (opts.dataLabelPosition || 'inEnd') + "\"/>";

gitbrent commented 3 years ago

Fixed via Pull #938