bar-chart-simple

2.0.2 • Public • Published

Bar-chart and Pie-Chart

react component for Bar Chart

NPM JavaScript Style Guide

Install

npm install --save bar-chart-simple

Usage

import React, { Component } from 'react'

import {ChartComponent} from 'bar-chart-simple'
import 'test-head/dist/index.css'

class Example extends Component {
  let data = [{
    "data_category": "USA",
    "data_value": 2025
   }, {
    "data_category": "China",
    "data_value": 1882
   }];
  render() {
    return <ChartComponent data={data} chart_type="pie_chart"/>
  }
}

Chart types

  • chart_type="pie_chart"
  • chart_type="bar_chart"

Sample Data

let data = [{
    "data_category": "USA",
    "data_value": 2025
   }, {
    "data_category": "China",
    "data_value": 1882
   }, {
    "data_category": "Japan",
    "data_value": 1809
   }, {
    "data_category": "Germany",
    "data_value": 1322
   }]

License

MIT ©

Readme

Keywords

none

Package Sidebar

Install

npm i bar-chart-simple

Weekly Downloads

4

Version

2.0.2

License

MIT

Unpacked Size

21.2 kB

Total Files

7

Last publish

Collaborators

  • aravindhm