Tiny Lightweight Javascript Graph Library | krap.js

krap.js is a lightweight, dependency-free JS library used to draw simple dynamic diagrams charts on an HTML page using SVG. Currently supports pie and bar column charts.

chartist js, javascript chart library, best javascript chart library, javascript chart library 2022, best chart library, javascript graph visualization

How to make use of it:

1. Import krap.js and krap.css into the HTML page.

<script src="krap.js"></script>
<link rel="stylesheet" href="krap.css">

2. Create a placeholder for the chart.

<div id="container" >
</div>

3. Select an array of objects that you want to display in the chart.

var json =[
    {oracle:[
      {profits:[
              {phones:1},
              {software:2}
      ]},
      {loss:[3]},
      {misc:[6]},
    ]},
    {amazon:[10]},
    {google:[60]},
    {microsoft:[20]}
];

4. Display the data as a pie chart inside the DIV container you created.

properties = {}
properties['width'] = 300;
properties['height']=300;
properties['data']= [10,30,60]
properties['colours']= ['#38D3EE', '#C9D2D4', '#FF5A82'];
chart.pie('pie',properties);

5. Display a pie chart inside the DIV container you created.

var  props = {
    'width': 300,
    'height': 300,
    'data': {'apple':5,'oracle':10,'google':15,'tesla':20,'A':15,'B':10,'C':5},
    'xCords': [],
    'yCords': [],
    'yCordsSorted': [],
    'divId': 'undefined',
    'datumsPerScreen': 4,
    'colours': {},
    'barColours': 'blue',
    'yTickLabels': {},
    'svgObj': 'undefined',
    'axisType': 'generateSimpleAxis'
};
chart.bar('bar',props);

Tiny Chart Library, krap.js Plugin/Github


See Demo And Download

Official Website(karthikkondapally): Click Here

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

Related Posts

Input-Values-Using-Mouse-Drag

Create Side Sliders Input Values Using Mouse Drag | Pointer Lock

HTML Range Slider is a lightweight library to create side sliders to adjust values easily and precisely by making use of the Pointer Lock API. Side Slider…

simple-parallax-scrolling-js

Smooth and Lightweight Parallax Scroll Library in Pure Javascript

Lightweight and seamless parallax scrolling library implemented in pure javascript using hardware acceleration for additional performance. Main Features Extremely lightweight with no dependencies A few kilobytes of pure…

Convert-Form-Data-to-JSON

How to Convert Form Data to JSON with HTML Forms | FormsJS

FormsJS is a simple-to-use JavaScript library that covers type subject values to JSON in real time. The items containing the data category will be analyzed automatically. It…

editable-html-table-using-javascript

A Small jQuery Extension to Convert An Editable HTML Table

Editable Table is a small jQuery extension to convert an editable HTML table for fast data entry and validation. A small jQuery extension to convert a static…

jquery.youtube-background

Simple jQuery Plugin for Embedding YouTube Videos As Cover Background

jquery.youtube-background is a jQuery plugin built to facilitate YouTube embeds as cover wallpaper using the YouTube Embed API. There is another jQuery Youtube Video Background plugin that…

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…