gitbrent / PptxGenJS

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

Add ability to add custom data labels to charts. #1337

Open yukosgiti opened 4 weeks ago

yukosgiti commented 4 weeks ago

image

With code like:

 this.slide.addChart(
      'line',
      [
        {
          name: 'Overall',
          labels: x.labels,
          values: x.data,
        },
        {
          name: 'Benchmark',
          labels: y.labels,
          values: y.benchmark,
          dataLabels: y.map((i) => `>>${i}<<`),
        },
        {
          name: 'Overall',
          labels: z.labels,
          values: z.overall,
          dataLabels: z.overall.map(
            (i) => `${i}, Count: ${Math.round(i * i)}`
          ),
        },
      ],