Home Forums Chart Support Changing color of a pie slice

Changing color of a pie slice

Viewing 2 posts - 1 through 2 (of 2 total)
  • #43034

    How can I change the color of a slice in an already rendered pie graph?

    #43042

    @xliff,

    You can change the color of a slice in the pie chart after it is rendered by updating the color of the corresponding datapoint in the chart options as shown in the code snippet below:

    chart.options.data[0].dataPoints[3].color = "red";
    chart.render();

    Please take a look at this documentation page for step-by-step tutorial on updating chart options.


    Thangaraj Raman
    Team CanvasJS

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.