Skip to content

[Bug | Issue] How to add the same color of the bar chart to the labels of the bar #1375

Open
@esuneelkumar722

Description

@esuneelkumar722

Product Versions:
Please specify what version of the library you are using......: [3.12.0]
Please specify what version(s) of PowerPoint you are targeting: [any]
Please specify what web browser you are using.................: [Microsoft Edge, chrome]

I am using the addChart property for to add the bar graph for the labels and values, and client requirement is use different color's for every bar and as well as respective color for the label's also. But I have observed that in the addchart dataLabelColor property accepts string format and only same color for the all the labels. I wanted to know is there any way to add different color for labels. Below is the sample code.

chartSlide.addChart(presentation.ChartType.bar, validBarChartData, {
x: 0.29,
y: 2.46,
w: 3.95,
h: 2.77,
// barColors = ['A100FF', '7500C0', '460073', 'FF50A0', '0041F0'];
dataLabelColor: '000000', // Black color for labels to ensure , // Here I wanted to same color as the chartColor's for different
labels respective that their bar color
chartColors: barColors, // Purple color for chart elements

Previous template:
Image

Expecting template:
Image

if you observe the bar chart labels in the previous template, it has the black color for all the data label, if you see expecting template, in that the data labels color for different bar is same and it matching to the color of the bar, I wanted to how we can achieve this requirement.
if this is possible by the current version and is there any way to get the expected template output, please let me know.
Thanks for the looking into this issue. Great Thanks.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions