![Back to school sale!](https://wpdatatables.com/wp-content/themes/wpdatatables-theme-docs/img/promo/back-to-school-sale-text-img.webp)
![Save up to 50%](https://wpdatatables.com/wp-content/themes/wpdatatables-theme-docs/img/promo/Save-up-to-50.webp)
There is no built-in option, but you can use wpdatachart callbacks. Every chart exposes several options that customize its look and feel. Charts usually support custom options appropriate to that visualization. You can use it for adding options that are available in Chart.js API. In this callback in method wpDataChartsCallbacks
82 is the ID of the chart for which you want to change colors. We used hex color codes with some random colors, but you can change it for your needs. There are six of them (if you have six series), if you had it more then you have to add more colors in colors array, separated by a comma (except last one). On the end insert this script above shortcode of your chart on the page.
<script type="text/javascript"> jQuery(window).on('load',function(){ if( typeof wpDataChartsCallbacks == 'undefined' ){ wpDataChartsCallbacks = {}; } wpDataChartsCallbacks[82] = function(obj){ obj.options.data.datasets[0].backgroundColor = [ '#50B432', '#ED561B', '#DDDF00', '#24CBE5', '#64E572', '#FF9655' ] } }); </script>
BUT FIRST!
Be the first to learn about updates and new features.
Once you have provided your email address, the download will commence shortly