Open In App

jQWidgets jqxChart renderEngine Property

Last Updated : 31 Oct, 2021
Improve
Improve
Like Article
Like
Save
Share
Report

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. The 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 renderEngine property is used to set or return the renderEngine property. i.e. this property is used to set or return the rendering engine used to display the chart. Depending on the browser capabilities, the jqxChart will automatically select an optimal rendering engine, when this property has not been set. It accepts string type values and the default value is .

Syntax:

  • It is used to set the renderEngine property.
    $('Selector').jqxChart({ renderEngine : string});
  •  

  • It is used to return the renderEngine property.
    var renderEngine = 
        $('Selector').jqxChart('renderEngine');

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 jqxChart renderEngine property in jQWidgets.

HTML




<!DOCTYPE html>
<html lang="en">
  
<head>
    <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>
</head>
  
<body>
    <center>
        <h1 style="color: green">
          GeeksforGeeks
        </h1>
        <h3>jQWidgets jqxChart renderEngine property</h3>
        <div class='default'></div>
      <div id='chartContainer'
           style="width:600px;  
           height: 400px">
      </div>
    </center>
      
    <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,
                renderEngine: 'HTML5',
                padding: { left: 50, top: 30, right: 50, bottom: 30 },
                categoryAxis:
                    {
                        dataField: 'Day',
                        showGridLines: true
                    },
                seriesGroups:
                    [
                        {
                            type: 'column',
                            columnsGapPercent: 30,
                            seriesGapPercent: 0,
                            valueAxis:
                            {
                                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' }
                                ]
                        }
                    ]
            };
            $('#chartContainer').jqxChart(obj);
        });
    </script>
</body>
  
</html>


Output:

Reference: https://www.jqwidgets.com/jquery-widgets-documentation/documentation/jqxchart/jquery-chart-api.htm?search=



Like Article
Suggest improvement
Previous
Next
Share your thoughts in the comments

Similar Reads