clear code
This commit is contained in:
parent
49c789b834
commit
36095db428
|
@ -3,7 +3,7 @@ import type { Meta, StoryObj } from '@storybook/react'
|
|||
import BalanceChardCard from './BalanceChardCard'
|
||||
|
||||
const meta = {
|
||||
title: 'Pages/BalanceChardCard',
|
||||
title: 'Dashboard/BalanceChardCard',
|
||||
component: BalanceChardCard,
|
||||
parameters: {
|
||||
layout: 'centered',
|
||||
|
|
|
@ -4,12 +4,8 @@ import {
|
|||
LinearScale,
|
||||
PointElement,
|
||||
LineElement,
|
||||
|
||||
Tooltip,
|
||||
Filler,
|
||||
Legend,
|
||||
} from 'chart.js';
|
||||
|
||||
import { Line } from 'react-chartjs-2';
|
||||
|
||||
ChartJS.register(
|
||||
|
@ -20,8 +16,6 @@ ChartJS.register(
|
|||
Filler,
|
||||
);
|
||||
|
||||
|
||||
|
||||
const years = ['APR', 'MAY', 'JUN', 'JUL', 'AUG', 'SEP', 'OCT', 'NOV', 'DEC', 'JAN', 'FEB', 'MAR', 'APR']
|
||||
|
||||
const userGains = [10000, 15000, 17500, 20000, 19000, 23222, 25000, 20000, 20000, 21000, 22300, 21000, 25000]
|
||||
|
@ -31,7 +25,6 @@ const data = {
|
|||
labels: years,
|
||||
datasets: [
|
||||
{
|
||||
|
||||
data: userGains,
|
||||
borderColor: '#1992D7',
|
||||
backgroundColor: '#f6fbfd',
|
||||
|
@ -41,17 +34,15 @@ const data = {
|
|||
|
||||
}
|
||||
],
|
||||
options: {
|
||||
responsive: true,
|
||||
maintainAspectRatio: true,
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
|
||||
const options = {
|
||||
responsive: true,
|
||||
maintainAspectRatio: true,
|
||||
};
|
||||
|
||||
const LineChart = () => {
|
||||
return <Line options={options} data={data} />;
|
||||
return <Line options={data.options} data={data} />;
|
||||
}
|
||||
|
||||
export default LineChart;
|
||||
|
|
Loading…
Reference in New Issue