In this article you will learn about how to change the color of a chart. First, login to the Helical Insight with the required credentials. Then, create or open the existing chart report. Also, using your data you can create your own chart reports. Similarly, using sample data a chart report is generated.
We have taken an Area Spline Chart, by default the color of the chart is blue.
To change the color will require a Javascript Code. To apply the code, go to Editor tab, click on JS editor then click on Add to enter the code then, click on Inject to execute the entered code.
Javascript Code:
hi_container.set("postExecution", function () {
Hdi.c3chart.data.colors({
"Travel Count" : 'Plum' // Legend Color is Customizable. You can specify either the name of color or its hex code like (#AABBCC)
});
});
// "Travel Count" is a legend which can vary depending on the fields used. Also there can be more than one legend
// in a single chart
Output :
In addition to it, you can do other chart customization. Please refer our chart customization blogs.
For more info, contact us at support@helicalinsight.com