|
2 | 2 | BarElement, CategoryScale, Chart as ChartJS, Legend, LinearScale, LineElement, PointElement, Tooltip |
3 | 3 | } from "chart.js" |
4 | 4 | import Head from "next/head" |
5 | | -import { DependencyList, EffectCallback, useEffect, useState } from "react" |
6 | | -import { Chart } from "react-chartjs-2" |
| 5 | +import { EffectCallback, useEffect, useState } from "react" |
| 6 | +import { Bar, Line } from "react-chartjs-2" |
7 | 7 | import FormattedLink from "../../components/FormattedLink" |
8 | 8 | import Main from "../../components/Main" |
9 | 9 | import styles from "../style.module.css" |
@@ -150,11 +150,10 @@ export default function GachaCalc({ location }: { location: string }) { |
150 | 150 | <h3 className="text-lg font-bold pt-1" id="resistance">Results:</h3> |
151 | 151 | <div className="columns-1 md:columns-2 mr-2"> |
152 | 152 | <div className="w-full bg-slate-800 rounded-xl p-1 my-2 md:my-0 text-white col-start-1"> |
153 | | - <Chart type="bar" data={({ |
| 153 | + <Bar data={({ |
154 | 154 | labels: calculated.filter(x => x).map(c => getName(c, banner)), |
155 | 155 | datasets: [ |
156 | 156 | { |
157 | | - type: "bar" as const, |
158 | 157 | label: "Rate", |
159 | 158 | backgroundColor: "rgb(75, 192, 192)", |
160 | 159 | data: calculated.filter(x => x).map((c, i, a) => c.rate * 100), |
@@ -183,11 +182,10 @@ export default function GachaCalc({ location }: { location: string }) { |
183 | 182 | } |
184 | 183 | })} /></div> |
185 | 184 | <div className="w-full bg-slate-800 rounded-xl p-1 my-2 md:my-0 text-white col-start-2"> |
186 | | - <Chart type="bar" data={({ |
| 185 | + <Line data={({ |
187 | 186 | labels: calculated.filter(x => x).map(c => getName(c, banner)), |
188 | 187 | datasets: [ |
189 | 188 | { |
190 | | - type: "line" as const, |
191 | 189 | label: "Cumulative rate", |
192 | 190 | borderColor: "rgb(255, 99, 132)", |
193 | 191 | borderWidth: 2, |
|
0 commit comments