PptxGenJS
PptxGenJS copied to clipboard
Chart Customization
This is a must-required feature for me. Can you please put all formatting variables in the chart data series? It would be a great help.
Originally posted by @adeelkhalid in https://github.com/gitbrent/PptxGenJS/issues/716#issuecomment-863817608
Hi again. I have managed to change the color for each category label by providing a color array.
`slide.addChart(pptx.ChartType.line, dataChartAreaLine, { x: 1, y: 1, w: 8, h: 4, showDataTable: true, showDataTableKeys: true, dataTableFontSize: 10, dataBorder: { pt: "1", color: "92D050" }, border: { pt: "1", color: "92D050" }, valAxisHidden: true, showValue: true, chartColors: ["92D050", "FF0000"], dataLabelPosition: "t",
dataLabelColorArray: ["92D050", "FF0000"], //color array for labels
dataLabelColor: "92D051", });`
Changed one line located on line 751 in gen-charts.ts
// default line
strXml += ' <a:solidFill>' + createColorElement(opts.dataLabelColor || DEF_FONT_COLOR) + '</a:solidFill>'
//changed
strXml += ' <a:solidFill>' + createColorElement(opts.dataLabelColorArray[idx] || DEF_FONT_COLOR) + '</a:solidFill>'
Hi, Do you have implement this property : dataLabelColorArray ?