mirror of
https://github.com/FranP-code/spend-ia.git
synced 2025-10-13 00:14:09 +00:00
integration of next.js
This commit is contained in:
22
components/PieCircle.tsx
Normal file
22
components/PieCircle.tsx
Normal file
@@ -0,0 +1,22 @@
|
||||
import React from 'react';
|
||||
import { Chart as ChartJS, ArcElement, Tooltip, Legend } from 'chart.js';
|
||||
import { Pie } from 'react-chartjs-2';
|
||||
|
||||
export const PieCircle = (): JSX.Element => {
|
||||
ChartJS.register(ArcElement, Tooltip, Legend);
|
||||
return (
|
||||
<Pie
|
||||
data={{
|
||||
datasets: [
|
||||
{
|
||||
backgroundColor: ['rgb(255, 99, 132)', 'rgb(54, 162, 235)', 'rgb(255, 205, 86)'],
|
||||
data: [300, 50, 100],
|
||||
hoverOffset: 4,
|
||||
label: 'My First Dataset',
|
||||
},
|
||||
],
|
||||
labels: ['Red', 'Blue', 'Yellow'],
|
||||
}}
|
||||
></Pie>
|
||||
);
|
||||
};
|
||||
1
components/index.ts
Normal file
1
components/index.ts
Normal file
@@ -0,0 +1 @@
|
||||
export * from './PieCircle';
|
||||
Reference in New Issue
Block a user