A Small, Customizable JavaScript Library for Making Simple SVG Graphs | odi.linechart.js

odi.linechart.js is a small, customizable, standalone JavaScript library for making simple SVG diagrams / graphs for ODI Leeds projects.

svg chart library, svg line graph generator, svg chart generator, free svg charts, js svg line chart, native svg pie chart

Vue Node-based SVG Visual Graphs Visualization Components | vnodes

How to make use of it:

1. Load the odi.linechart.js JavaScript library.

<script src="odi.linechart.js"></script>

2. Create a chart container on the web page.

<div id="example"></div>

3. Initialize the odi.linechart.js and outline your personal data series as follows:

var example = ODI.linechart(document.getElementById('custom'),{

    // offset
    'left':20,
    'right':50,
    'top':60,
    'bottom':8,

    // define your data here
    'axis':{
      'x':{
        'line': {'stroke':'#888', 'stroke-width': 2},
        'grid': {'show':true,'stroke':'#888'},
        'labels':{
          2014: {'label':'2014','fill':'#888','length':0,'align':'top','dy':-60},
          2015: {'label':"'15",'fill':'#888','length':0,'align':'top','dy':-60},
          2016: {'label':"'16",'fill':'#888','length':0,'align':'top','dy':-60},
          2017: {'label':"'17",'fill':'#888','length':0,'align':'top','dy':-60},
          2018: {'label':"'18",'fill':'#888','length':0,'align':'top','dy':-60},
          2019: {'label':"'19",'fill':'#888','length':0,'align':'top','dy':-60},
          2020: {'label':"2020",'fill':'#888','length':0,'align':'top','dy':-60}
        }
      },
      'y':{
        'line': {'show':false},
        'grid': {'show':true,'stroke':'#888'},
        'min': 0,
        'max': 200,
        'labels':{
          0: {'label':'0','fill':'white','align':'right'},
          50: {'label':'50M','fill':'white','align':'right'},
          100: {'label':'100M','fill':'white','align':'right'},
          150: {'label':'150M','fill':'white','align':'right'}
        }
      }
    },

    // Draw a key
    'key':{ 'show':true },
    
});

4. Draw the line chart.

example.draw();

5. Set the height & width of the line chart.

#example { 
  height: 400px; 
  width: 100%; 
  animation-duration: 0.3s; 
}

6. Add extra data series to the line chart.

var maxtemp = [{x:1,y:6.4},{x:2,y:7},{x:3,y:9.1},{x:4,y:11.9},{x:5,y:14.8},{x:6,y:17.5},{x:7,y:19.6},{x:8,y:19},{x:9,y:16.9},{x:10,y:13.3},{x:11,y:9.1},{x:12,y:6.7}];
var mintemp = [{x:1,y:1.8},{x:2,y:1.4},{x:3,y:2.2},{x:4,y:3.9},{x:5,y:7},{x:6,y:9.9},{x:7,y:12.1},{x:8,y:12},{x:9,y:10.1},{x:10,y:7.6},{x:11,y:4.3},{x:12,y:2.2}];

example.addSeries(maxtemp,{
  'title': 'Max temperature',
  'points':{ 'size':4, 'color': '#FF6700' },
  'line':{ 'color': '#FF6700' },
  'tooltip':{ 'label': label }
});

example.addSeries(mintemp,{
  'title': 'Min temperature',
  'points':{ 'size':4, 'color': '#2254F4' },
  'line':{ 'color': '#2254F4' },
  'tooltip':{ 'label': label }
});

Customizable SVG Line Chart, odi.linechart.js Plugin/Github


See Demo And Download

Official Website(odileeds): Click Here

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

Related Posts

Fullscreen-Lightbox-Plugin

Simple And Powerful Fullscreen Lightbox Plugin | fslightbox

Fullscreen Lightbox Basic is a modern and handy plug-in for displaying photos and videos in a clean overlay box. Showcase a single source or create a great…

product-thumbnail-slider-with-zoom-effect-jquery

Product Thumbnail Slider With Positive Zoom Effect jQuery

Positive Zoom is a JavaScript library for creating an image gallery where you can zoom in on the current image by hovering over it. Must Read: Pure…

CSS-Gauge-Meter

Create Responsive Gauge Meter Using Pure CSS | CSSGauge

Pure CSS Gauge Meter Component, no SVG, or artboard is used in this component. This component can be easily distinguished by overriding the default style rules and…

bulma-datepicker

Versatile Date and Time Picker Calendar for Bulma

Bulma extension for calendar display can be used on a page as a large calendar with appointments or as a date picker/popup window. A responsive, customizable, and…

javascript-time-series-chart-library

Simple Time-Series Chart Viewer with HTML5 Canvas Javascript Library

Pixl chart library displays time series charts in the browser, using the HTML5 Canvas element. It is designed to be lightweight and efficient, while still providing a…

Neumorphic-Design-CSS

Neumorphic Design Inspiration Style CSS Shapes | Neumorphism

Multi-dimensional design is inspired by the physical world and adds textures, reflection, shadows, layers, and depths to the flat design making the UI elements more visible. CSS…