Change color on ApexChart pie chart

Contents

Description

Charts usually support custom options appropriate to that visualization. You can use it for adding options that are available in ApexChart API options. In this callback, in the method wpDataChartsCallbacks 40 is the ID of the chart in which you want to change colors. We used hex color codes with some random colors, but you can change them for your needs. There are eleven of them (if you have eleven series), if you have more then you have to add more colors in the colors array, separated by a comma (except the last one). On the end insert this script above the shortcode of your chart on the page.

Examples