[Question]Coloring bars different colors when plotting 2 series
Issue Category
- [ ] Question
Product Versions
- Please specify what version of the library you are using......: [3.11.0]
- Please specify what web browser you are using.................: [ Chrome ]
Desired Behavior
When plotting two series bar charts, how do I color the bars individually of different colors?
What I want to achieve is this -
I have achieved this -
Steps to Reproduce
I tried coloring the bars individually by passing in two arrays inside an array for param chartColors like so -
slide.addChart(pptx.ChartType.bar, data,
{
x: 0.15, y: 1.4, w: 8, h: 3.7,
layout: { x: 0.3, y: 0.05, w: 1, h: 0.8 },
barDir: "col",
barGapWidthPct: 80,
barOverlapPct: 50,
chartColors: [['e5e5e5'], ['7a86cc', '4ed1e1', '83c786', '7a86cc']],
});
This does not work, I also tried passsing it as a single array chartColors: ['e5e5e5', '7a86cc', '4ed1e1', '83c786', '7a86cc'] but that does not work either. The second series always picks up the color at index 1('7a86cc') and that color remains for the whole series.
Is this currently supported? And if yes how do i pass the chartColors for it? I couldn't find any relevant documentation for this specific use-case. Thanks!
From my understanding, if you have only 1 series then each color of the chartColors represents each data item of that series. If you have more than 1 series, then each color of the chartColors represents all data items of that series.
I also have a use case where I would like to choose different colors within each of my series. Is there any update on this?
would also love to understand how to do this. i've tried creating a combo chart to achieve it, but it's not working that well.