react-chart-js/examples/line-chart-example
Sambo Chea 24d3fe60f4
Updated examples and package
2021-11-11 16:31:59 +07:00
..
public updated the example projects and updated to the examples 2020-10-15 09:33:20 +07:00
src Updated examples and package 2021-11-11 16:31:59 +07:00
.env updated the example projects and updated to the examples 2020-10-15 09:33:20 +07:00
.gitignore remove the dists and update to new version 1.1.4 2020-10-15 10:21:45 +07:00
package.json Updated examples and package 2021-11-11 16:31:59 +07:00
README.md updated the example projects and updated to the examples 2020-10-15 09:33:20 +07:00
tsconfig.json updated the example projects and updated to the examples 2020-10-15 09:33:20 +07:00

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;