diff options
| author | Pinapelz <yukais@pinapelz.com> | 2024-10-07 10:58:49 -0700 |
|---|---|---|
| committer | Pinapelz <yukais@pinapelz.com> | 2024-10-07 10:58:49 -0700 |
| commit | e23005df1e1320729589091f7a2547aa6fac593a (patch) | |
| tree | 83008a84ec07f953962ab257a6e03a7a147f07d9 /src/components/DataChart | |
| parent | 32926759fc5a9d9c1f472da7ad7833f27ad2c37b (diff) | |
fix some biomejs lint issues
Diffstat (limited to 'src/components/DataChart')
| -rw-r--r-- | src/components/DataChart/DataChart.tsx | 127 |
1 files changed, 63 insertions, 64 deletions
diff --git a/src/components/DataChart/DataChart.tsx b/src/components/DataChart/DataChart.tsx index 3b8304a..7d95abe 100644 --- a/src/components/DataChart/DataChart.tsx +++ b/src/components/DataChart/DataChart.tsx @@ -1,82 +1,81 @@ import { - CategoryScale, - Chart as ChartJS, - Legend, - LineElement, - LinearScale, - PointElement, - Title, - Tooltip, + CategoryScale, + Chart as ChartJS, + Legend, + LineElement, + LinearScale, + PointElement, + Title, + Tooltip, } from "chart.js"; import type React from "react"; import { Line } from "react-chartjs-2"; ChartJS.register( - CategoryScale, - LinearScale, - PointElement, - LineElement, - Title, - Tooltip, - Legend, + CategoryScale, + LinearScale, + PointElement, + LineElement, + Title, + Tooltip, + Legend, ); interface DataChartProps { - chartData?: any; - graphTitle?: string; - fullData?: boolean; - overrideBorderColor?: string; - overrideBGColor?: string; + chartData?: any; + graphTitle?: string; + fullData?: boolean; + overrideBorderColor?: string; + overrideBGColor?: string; } const DataChart: React.FC<DataChartProps> = ({ - chartData, - graphTitle, - fullData, - overrideBGColor, - overrideBorderColor, + chartData, + graphTitle, + fullData, + overrideBGColor, + overrideBorderColor, }) => { - const options = { - responsive: true, - plugins: { - legend: { - position: "top" as const, - }, - title: { - display: true, - text: graphTitle || "Historical Subscriber Data", - font: { - size: 18, - }, - }, - }, - scales: { - x: { - ticks: { - autoSkip: true, - maxTicksLimit: 10, - }, - }, - }, - }; + const options = { + responsive: true, + plugins: { + legend: { + position: "top" as const, + }, + title: { + display: true, + text: graphTitle || "Historical Subscriber Data", + font: { + size: 18, + }, + }, + }, + scales: { + x: { + ticks: { + autoSkip: true, + maxTicksLimit: 10, + }, + }, + }, + }; - const data = { - labels: chartData.labels, - datasets: [ - { - label: "Subscriber Count", - data: chartData.datasets, - borderColor: overrideBorderColor || "rgb(255, 99, 132)", - backgroundColor: overrideBGColor || "rgba(255, 99, 132, 0.5)", - }, - ], - }; + const data = { + labels: chartData.labels, + datasets: [ + { + label: "Subscriber Count", + data: chartData.datasets, + borderColor: overrideBorderColor || "rgb(255, 99, 132)", + backgroundColor: overrideBGColor || "rgba(255, 99, 132, 0.5)", + }, + ], + }; - if (!fullData) { - return <Line options={options} data={data} />; - } else { - return <Line options={options} data={chartData} />; - } + if (!fullData) { + return <Line options={options} data={data} />; + } + return <Line options={options} data={chartData} />; }; export default DataChart; |
