1.0.0 • Published 3 years ago

chartjs-react-ts v1.0.0

Weekly downloads
-
License
MIT
Repository
-
Last release
3 years ago

chartjs-react-ts

A minimal React TypeScript wrapper for ChartJs provides access to the instance by ref.

Installation

npm i chartjs-react-ts OR yarn add chartjs-react-ts

import { ChartJs } from 'chartjs-react-ts'
import { Chart, <REQUIRED FEATURES> } from 'chart.js'

Chart.register(<REQUIRED FEATURES>);

const App = () => {
  const chartRef = useRef<Chart | null>(null);

  return (
    <ChartJs type='line' data={data} options={options} chartRef={chartRef}>Not supported</ChartJs>
  )
}
1.0.0

3 years ago