Full Featured Data Visualization Library – tui.chart

Category: Chart & Graph , Javascript , Recommended | August 4, 2018
Author: nhnent
Views Total: 530
Official Page: Go to website
Last Update: August 4, 2018
License: MIT

Preview:

Full Featured Data Visualization Library  – tui.chart

Description:

tui.chart is a JavaScript data visualization library which makes uses of Raphaël.js to create a wide variety of charts & graphs using SVG.

Charts & Graphs supported:

  • Area Chart
  • Bar Chart
  • Box Plot Chart
  • Bubble Chart
  • Bullet Chart
  • Column Chart
  • Column Line Combo Chart
  • Heatmap Chart
  • Line Area Combo Chart
  • Line Chart
  • Line Scatter Combo Chart
  • Map Chart
  • Pie Chart
  • Pie Donut Combo Chart
  • Radial Chart
  • Scatter Chart
  • Treemap Chart

Basic usage:

Installation with NPM:

# NPM
$ npm install tui-chart --save

Import the tui-chart package.

// ES 6
import chart from 'tui-chart';

// CommonJS:
const chart = require('tui-chart');

Create a container element in which you want to place the chart.

<div id="myChart">
</div>

Prepare your data to be plotted in the chart.

var data = {
    categories: ['June', 'July', 'Aug', 'Sep', 'Oct', 'Nov'],
    series: [
        {
            name: 'Budget',
            data: [5000, 3000, 5000, 7000, 6000, 4000]
        },
        {
            name: 'Income',
            data: [8000, 1000, 7000, 2000, 5000, 3000]
        }
    ]
};

Pass the optional settings.

var options = {
    chart: {
        width: 1160,
        height: 650,
        title: 'Monthly Revenue',
        format: '1,000'
    },
    yAxis: {
        title: 'Month'
    },
    xAxis: {
        title: 'Amount',
        min: 0,
        max: 9000,
        suffix: '$'
    },
     series: {
         showLabel: true
     }
};

Apply custom themes.

var theme = {
    series: {
        colors: [
            '#83b14e', '#458a3f', '#295ba0', '#2a4175', '#289399',
            '#289399', '#617178', '#8a9a9a', '#516f7d', '#dddddd'
        ]
    }
};

Generate a basic bar chart on the page.

var container = document.getElementById('myChart');
tui.chart.barChart(container, data, options);

You Might Be Interested In:

Leave a Reply