Simple Animated jQuery & SVG Based Graph Plugin

Graph.js is an interactive and customizable jQuery plugin that takes advantage of HTML5 SVG to create linear, area, bar, combo, pie, and donut graphs with support for multiple data sets.

Features:

  • jQuery plugin.
  • Linear, area, bar, combo, pie, and donut graphs, as well as tables,
  • Legend keys for multiple datasets and pie and donut graphs (simple legend keys for individual datasets),
  • Supports multiple data sets,
  • Full grids, vertical and horizontal grids, no grids…,
    supports interaction,
  • Lightweight,
  • Graphs can be changed from one type to another (including tables): graph.to (“linear”);
  • easy to use,
  • Every inch is customizable,
  • animation

How to make use of it:

1. Create an empty container(ID) to place your SVG graphic.

<div id="graph"></div>

2. Include the latest version of the jQuery library.

<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script>
<script src="graph.js"></script>

3. Create the data in javascript and initialize the graph.

<script>
$(function(){
$('#graph').graphify({
start: 'combo', // //type of graph to start with
obj: {
id: 'ggg',
width: 775,
height: 375,
xGrid: false, // False will remove vertical grid lines
legend: true, // Show a legend?
title: 'Linux vs Mac',
points: [
[7, 26, 33, 74, 12, 49, 33],
[32, 46, 75, 38, 62, 20, 52]
],
pointRadius: 3,
colors: ['blue', 'red'],
xDist: 90, // Horizontal distance between vertical grid lines (Makes graph wider)
dataNames: ['Linux', 'Mac'],
xName: 'Day', // Name of X-Axis
tooltipWidth: 15,
animations: true,
pointAnimation: true,
averagePointRadius: 10,
design: {
tooltipColor: '#fff',
gridColor: 'grey',
tooltipBoxColor: 'green',
averageLineColor: 'green',
pointColor: 'green',
lineStrokeColor: 'grey',
}
}
});
});
</script>

4. More options with default values.

xDist: 60,
yDist: 30,
scale: 10,
//leave space for labels:
xOffset: 25,
yOffset: 20,
yStart: 0, // what number do we want to start from for y labels
mainOffset: 35, //to seperate everything from the ylabels
padding: 10, //keep labels from touching edges
//single points
xOfPoints: [], //get x and y coordinates of points
yOfPoints: [],
//multiple points
mxOfPoints: [],
myOfPoints: [],
multipleDataSets: false,
legend: false,
interactive: true,
animations: false,
animationDuration: 1,
pointAnimation: true,
lineAnimation: true,
barAnimation: true,
pieAnimation: true,
grid: true,
xGrid: true,
yGrid: true,
xName: null,
yName: null,
special: null,
showPoints: true,
noLines: false,
pointRadius: 5,
averagePointRadius: 5,
pieSize: 200,
tooltipWidth: 50,
pieLegend: true,
rx: 10, //tooltip roundedness
//add some html before append
before: '',
//after append:
after: '',
title: '', //title of graph to be written in SVG

 

donut-chart-html-css-javascript


See Demo And Download

Official Website(uriahsanders): Click Here

This superior jQuery/javascript plugin is developed by uriahsanders. For extra Advanced Usage, please go to the official website.

Related Posts

Floating-Whatsapp-Chat-Button

How to Add Floating Whatsapp Chat Button In HTML | venom-button

Venom Button is a very simple plugin for the jQuery floating WhatsApp button. Adds a floating button to your site that calls WhatsApp Click to Chat API. It will automatically start the WhatsApp…

Data-Table-Generator-Tabulator

Interactive Data Table Generator with JS/jQuery and JSON | Tabulator

Tabulator allows you to create interactive tables in seconds from any HTML Table, JavaScript array, AJAX data source, or JSON format data. Just include the library in your…

alert-confirm-prompt-attention-js

Simple Alert, Confirm, Prompt Popup Using Vanilla JavaScript Library | attention.js

JavaScript provides various built-in functionality to display popup messages for different purposes. Attention JS is a vanillaJS plugin used to create a custom alert, confirm, or Prompt…

Bootstrap-4-Sidebar-Menu-Responsive-Template

Bootstrap 4 Sidebar Menu Responsive Template | MDB

Bootstrap Side Navbar – Responsive sidebar template based on the Bootstrap 4 framework. An easy-to-use, totally responsive, Google Material Design impressed aspect navigation for modern web app…

Bootstrap-4-Toast-Notification-Plugin

Lightweight Bootstrap 4 Toast Notification Plugin | BS4 Advanced Toast

A lightweight Bootstrap 4 Toast Notification plugin integrated with JS/jQuery. bs4-toast.js is a JavaScript library that enhances the native Bootstrap toast component with icons, buttons, callbacks, and…

Audio-Visualizations-Wave

How to Create Audio Visualizations with JavaScript | Wave.js

Audio Visualizer Library – wave.js is a vanilla javascript audio visualization library that provides 20+ creative audio visualization effects to bring more engagement to your visitor. Contribute…

Leave a Reply

Your email address will not be published. Required fields are marked *