Create HTML5 Canvas Chart Using Vanilla JS Library

g-chart are charts implemented with vanilla JS, they support tooltips with mouse hover and click interaction.

create graph in html code example, canvasjs chart example, html5 canvas charts library

How to make use of it:

1. Load the JavaScript file into the HTML document.

<script src="g-chart.line.js"></script>
<script src="g-chart.pie.js"></script>

2. Create your own data, and name the arrays of tooltips to be presented in the pie or line charts.

var data   = [ 12,   15,   13,   22,   8,   12,   31,   3,   5 ];
var label  = ['12', '15', '13', '22', '8', '12', '31', '3', '5'];
var tooltip  = ['Twelve', 'Fifteen', 'Thirteen', 'Twenty-two', 'Eight', 'Twelve', 'Thirdy-one', 'Three', 'Five'];

3. Create an HTML5 panel element for the graph.

<canvas id="pie" width="400" height="400"></canvas>
<canvas id="line" width="600" height="400"></canvas>

Minimal HTML5 Canvas Chart Library, g-chart Plugin/Github


See Demo And Download

Official Website(guschnwg): Click Here

This superior jQuery/javascript plugin is developed by guschnwg. For extra advanced usage, please go to the official website.

Share