'How to create Multi Type Charts with pptxgenjs

I am using PptGenJs (https://gitbrent.github.io/PptxGenJS/docs/api-charts/) to create a Multi Type Chart (a bar and a line in the same chart) in my Angular application. I am testing the demo code from the PptGenJs-Github-Repo, which you can find it here: https://github.com/gitbrent/PptxGenJS/blob/master/demos/modules/demo_chart.mjs#L1715

I am surprised to find that it doesn't work in my case. I have PptGenJs Version of 3.10.0 and Angular Version of 13.2.0.

The problems are:

  1. charts are not found in "type: pptx.charts.BAR". Instead, I have to change it to "type: pptx.ChartType.bar"

  2. the method of "slide.addChart(chartTypes, opts)" shows error. It seems that the parameter of "data" is missing according to its documentation:

addChart(type: CHART_NAME | IChartMulti[], data: any[], options?: IChartOpts): Slide

I must have done something wrong, but have no idea. Could anyone help me? Many thanks.

regards, CC



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source