5👍
For the current version of react-chartjs-2
(3/13/2022) the code below worked for me but the answer by HartleySan didn’t change the output.
I’m using Nextjs with
chart.js: 3.7.1
,
react-chartjs-2: 4.0.1
,
<Line
datasetIdKey="id"
data={data}
options={{
scales: {
yAxis: {
min: 0,
max: 100,
},
....
},
}}
/>
- [Chartjs]-Gradient color for each bar in a bar graph using ChartJS
- [Chartjs]-How can I hide tooltip in Chart.js on a specific data label?
4👍
Ugh! So frustrating, but I finally found the answer. The following worked for me:
{
scales: {
xAxes: [{
ticks: {
beginAtZero: true,
max: 1000,
min: 0
}
}],
yAxes: [{
ticks: {
beginAtZero: false,
max: 8,
min: -3
}
}]
}
}
Source:stackexchange.com