@cubetiq/react-chart-js
TypeScript icon, indicating that this package has built-in type declarations

1.1.9 • Public • Published

React Chart.js Component

Install

Using NPM

npm install @cubetiq/react-chart-js

OR using Yarn

yarn add @cubetiq/react-chart-js

View a Demo

Line Chart Example

import React from 'react';
import { ReactChartJs } from '@cubetiq/react-chart-js';

function LineChartExample(props) {
    return (
        <ReactChartJs
            chartConfig={{
                type: 'line',
                options: {
                    responsive: true,
                    title: {
                        display: true,
                        text: 'Monthly Payments',
                    },
                    tooltips: {
                        mode: 'index',
                        intersect: false,
                    },
                    hover: {
                        mode: 'nearest',
                        intersect: true,
                    },
                },
                data: {
                    datasets: [
                        {
                            label: 'Part-time',
                            data: [5, 10, 30],
                            fill: false,
                            borderColor: '#ff6384',
                        },
                        {
                            label: 'Full-time',
                            data: [10, 15, 45],
                            fill: false,
                            borderColor: '#36a2eb',
                        },
                    ],
                    labels: ['Jan', 'Feb', 'Mar'],
                },
            }}
        />
    );
}

export default LineChartExample;

Contributors

Project's repository: React Countdown

Package Sidebar

Install

npm i @cubetiq/react-chart-js

Weekly Downloads

24

Version

1.1.9

License

MIT

Unpacked Size

15.7 kB

Total Files

13

Last publish

Collaborators

  • vutpov
  • sombochea