Skip to content
Related Articles
Get the best out of our app
GeeksforGeeks App
Open App

Related Articles

jQWidgets jqxChart addColorScheme() Method

Improve Article
Save Article
Like Article
Improve Article
Save Article
Like Article

jQWidgets is a JavaScript framework for making web-based applications for PC and mobile devices. It is a very powerful and optimized framework, platform-independent, and widely supported. jqxChart is a lightweight and powerful chart widget written 100% in JavaScript. It offers many advanced features and supports three different rendering technologies – SVG, HTML5 Canvas & VML.

The addColorScheme() method is used to set a new color scheme. It takes string,array type value and does not return any value.


$('Selector').jqxChart('addColorScheme', 'string,array');

Linked Files: Download jQWidgets from the link. In the HTML file, locate the script files in the downloaded folder:

<link rel=”stylesheet” href=”jqwidgets/styles/jqx.base.css” type=”text/css” />
<script type=”text/javascript” src=”scripts/jquery-1.11.1.min.js”></script>
<script type=”text/javascript” src=”jqwidgets/jqxcore.js”></script>
<script type=”text/javascript” src=”jqwidgets/jqxchart.core.js”></script>
<script type=”text/javascript” src=”jqwidgets/jqxdraw.js”></script>
<script type=”text/javascript” src=”jqwidgets/jqxdata.js”></script>

Example: The below example illustrates the jqxHeatMap addColorScheme() method in jQWidgets:


<!DOCTYPE html>
<html lang="en">
    <link rel="stylesheet" 
          type="text/css" />
    <script type="text/javascript" 
    <script type="text/javascript" 
    <script type="text/javascript" 
    <script type="text/javascript" 
    <script type="text/javascript" 
        <h1 style="color: green">
        <h3>jQWidgets jqxChart addColorScheme() method</h3>
        <body class='default'></body>
                    <button id='gfg'>Click Here</button>
        <div id='chartContainer' 
             style="width:600px; height: 400px"/>
    <script type="text/javascript">
        $(document).ready(function () {
            var  json = [
              { Day:'Monday', A:3, B:1, C: 2, D:1},
              { Day:'Tuesday', A:3, B:1, C: 2, D:1},
              { Day:'Wednesday', A:3, B:1, C: 2, D:1},
              { Day:'Thursday', A:3, B:1, C: 2, D:1},
              { Day:'Friday', A:3, B:1, C: 2, D:1},
              { Day:'Saturday', A:3, B:1, C: 2, D:1},
              { Day:'Sunday', A:3, B:1, C: 2, D:1}
            var obj = {
                title: "Coding Score",
                description: "Coding Questions Solved Daily",
                source: json,
                toolTipMoveDuration: 1000,
                        dataField: 'Day',
                        showGridLines: true
                            type: 'column',
                            columnsGapPercent: 30,
                            seriesGapPercent: 0,
                                minValue: 0,
                                maxValue: 10,
                                unitInterval: 10,
                                description: 'Questions Solved'
                            series: [
                              { dataField: 'A', displayText: 'A'},
                              { dataField: 'B', displayText: 'B'},
                              { dataField: 'C', displayText: 'C'},
                              { dataField: 'D', displayText: 'D'}
             $('#gfg').click(function () {
                  'addColorScheme', 'myScheme', 
                  ['#00ff51', '#0516fc', '#ff00e1','#120d11']
                       'colorScheme', 'myScheme'



My Personal Notes arrow_drop_up
Last Updated : 07 Nov, 2021
Like Article
Save Article
Similar Reads
Related Tutorials