Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
How to set the color for bars in Javascript Excel chart

I want to control the color for each series for a barClustered Excel chart.

I have gotten as far as the statement below to retrieve the ChartFillBase, however, I can't find any documentation on how to actually set the colors or other characteristics of each series. How is this done?

series = Chart1.seriesCollection();

  • 54937
    Verified Answer
    Offline posted

    The parameterless method would be the getter. You'll want to pass the chart fill that you want it to use. In all likelihood you want a solid color so you'd use the ChartSolidFill. The constructor for which takes a WorkbookColorInfo. e.g.

    var clr = new $.ig.excel.WorkbookColorInfo("#FF0000");
    series.fill(new $.ig.excel.ChartSolidFill(clr));