Compare commits
3 Commits
55e9969a8c
...
24d3fe60f4
Author | SHA1 | Date | |
---|---|---|---|
24d3fe60f4 | |||
ab50c04230 | |||
e3d5cedc1d |
@ -3,7 +3,7 @@
|
||||
"version": "0.1.0",
|
||||
"private": true,
|
||||
"dependencies": {
|
||||
"@cubetiq/react-chart-js": "^1.1.6",
|
||||
"@cubetiq/react-chart-js": "^1.1.9",
|
||||
"@testing-library/jest-dom": "^4.2.4",
|
||||
"@testing-library/react": "^9.3.2",
|
||||
"@testing-library/user-event": "^7.1.2",
|
||||
|
@ -5,38 +5,17 @@ function LineChartExample(props: any) {
|
||||
return (
|
||||
<ReactChartJs
|
||||
chartConfig={{
|
||||
type: 'line',
|
||||
options: {
|
||||
responsive: true,
|
||||
title: {
|
||||
display: true,
|
||||
text: 'Monthly Payments',
|
||||
},
|
||||
tooltips: {
|
||||
mode: 'index',
|
||||
intersect: false,
|
||||
},
|
||||
hover: {
|
||||
mode: 'nearest',
|
||||
intersect: true,
|
||||
},
|
||||
},
|
||||
type: 'pie',
|
||||
data: {
|
||||
labels: ['Red', 'Blue', 'Yellow'],
|
||||
datasets: [
|
||||
{
|
||||
label: 'Part-time',
|
||||
data: [5, 10, 30],
|
||||
fill: false,
|
||||
borderColor: '#ff6384',
|
||||
},
|
||||
{
|
||||
label: 'Full-time',
|
||||
data: [10, 15, 45],
|
||||
fill: false,
|
||||
borderColor: '#36a2eb',
|
||||
label: 'My First Dataset',
|
||||
data: [300, 50, 100],
|
||||
backgroundColor: ['rgb(255, 99, 132)', 'rgb(54, 162, 235)', 'rgb(255, 205, 86)'],
|
||||
hoverOffset: 4,
|
||||
},
|
||||
],
|
||||
labels: ['Jan', 'Feb', 'Mar'],
|
||||
},
|
||||
}}
|
||||
/>
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@cubetiq/react-chart-js",
|
||||
"version": "1.1.7",
|
||||
"version": "1.1.9",
|
||||
"description": "Chart.js for React and TypeScript",
|
||||
"main": "./dist/index.js",
|
||||
"types": "./dist/index.d.ts",
|
||||
@ -30,7 +30,7 @@
|
||||
"scripts": {
|
||||
"build": "tsc",
|
||||
"test": "jest",
|
||||
"pub": "yarn build && npm publish --access public",
|
||||
"pub": "npm publish --access public --registry https://registry.npmjs.org",
|
||||
"build:test": "yarn jest && yarn build",
|
||||
"run:example": "cd examples/line-chart-example && yarn start"
|
||||
},
|
||||
|
@ -1,12 +1,13 @@
|
||||
import { Chart, ChartConfiguration } from 'chart.js';
|
||||
import Chart from 'chart.js/auto';
|
||||
import { ChartConfiguration } from 'chart.js';
|
||||
import React, { FunctionComponent, useEffect, useRef } from 'react';
|
||||
|
||||
interface ReactChartJSProps {
|
||||
chartConfig?: ChartConfiguration;
|
||||
chartConfig: ChartConfiguration;
|
||||
width?: number;
|
||||
height?: number;
|
||||
containerProps: any;
|
||||
canvasProps: any;
|
||||
containerProps?: any;
|
||||
canvasProps?: any;
|
||||
}
|
||||
|
||||
interface RefForChartInstance {
|
||||
|
Loading…
Reference in New Issue
Block a user