Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

rc-chartist

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

rc-chartist

React component for Chartist.js

  • 0.10.2
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1
Maintainers
1
Weekly downloads
 
Created
Source

rc-chartist

NPM version Downloads

React component for Chartist.js

Installation

$ npm install rc-chartist --save

Usage

import React from 'react';
import ReactDOM from 'react-dom';
import { Graph, Interpolation } from '../index';

class Pie extends React.Component {
  render () {

    var data = {
      labels: ['W1', 'W2', 'W3', 'W4', 'W5', 'W6', 'W7', 'W8', 'W9', 'W10'],
      series: [
        [1, 2, 4, 8, 6, -2, -1, -4, -6, -2]
      ]
    };

    var options = {
      high: 10,
      low: -10,
      // lineSmoothing: Interpolation.simple(),
      axisX: {
        labelInterpolationFnc: function(value, index) {
          return index % 2 === 0 ? value : null;
        }
      }
    };

    var type = 'Bar'

    return (
      <div>
        <Graph data={data} options={options} type={type} />
      </div>
    )
  }
}

ReactDOM.render(<Pie />, document.body)

Options

Please check out Chartist.js API documentation for more details of the options.

  • data - chart data (required)
  • type - chart type (required)
  • style - inline css styles (optional)
  • options - chart options (optional)
  • responsive-options - chart responsive options (optional)

To add support for aspect ratio

<Graph className={'ct-octave'} data={data} options={options} type={type} />

Note

This module does not include the css files for Chartist. If you want to add it, include their CDN in your html file

<link rel="stylesheet" href="//cdn.jsdelivr.net/chartist.js/latest/chartist.min.css">

Or use bower or npm to install Chartist and include it in your build process.

$ npm install chartist

Or

$ bower install chartist

Development

$ npm install

To build run npm run build

Changelog

Updated package to expose the entire Chartist API.

License

MIT

Keywords

FAQs

Package last updated on 20 Dec 2015

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc