Articles in this section
Category / Section

What are the options to specify color in JavaScript Chart?

1 min read
ghj

In Essential Chart, you can specify the color as a string value representing color name or rgb value of the color or hexadecimal code of the color. The following code example explains how to specify color for the Chart.

JS

$("#container").ejChart({
    commonSeriesOptions: {
        //specifying series fill color as rgb value
        fill: 'rgb(0,0,255)'
    },
    primaryXAxis: {
        font: {
            //specifying X axis label color using color name
            color: 'red'
        }
    },
    title:{
        text: 'Chart Title',
        font: {
            //specifying title text color using hexadecimal color code
            color: '#458B00'
        }
    }
});

 

The following screenshot displays the Chart with different colors for primary X axis labels, series interior and chart title. Here, color name is used to specify label color, rgb value is used to specify series interior color and hexadecimal code is used to specify chart title color.

The options to specify color in ejChart

Figure: Chart using colors in different formats like color name, rgb color value and hexadecimal color code

 

JS Playground sample link: Color options



Conclusion

I hope you enjoyed learning on the options to specify color in ejChart.

You can refer to our JavaScript charts feature tour page to know about its other groundbreaking feature representations and documentation, and how to quickly get started for configuration specifications. You can also explore our JavaScript Charts example to understand how to create and manipulate data.

For current customers, you can check out our components from the License and Downloads page. If you are new to Syncfusion, you can try our 30-day free trial to check out our other controls.

If you have any queries or require clarifications, please let us know in the comments section below. You can also contact us through our support forumsDirect-Trac, or feedback portal. We are always happy to assist you!


Did you find this information helpful?
Yes
No
Help us improve this page
Please provide feedback or comments
Comments (0)
Please  to leave a comment
Access denied
Access denied