Open CuongSofi opened 2 weeks ago
For these kind of questions please head over to Stack overflow.
Chart.js automatically adjusts the scale to your data. Unless you give it a max yourself. Since you have this behavior it seems you are setting a max somewhere in your application.
Documentation Is:
Please Explain in Detail...
Can you help me with some solutions to shorten the Oy axis when the values are too far apart?
Your Proposal for Changes
Can you help me shorten the Oy axis distance when my value has not reached 5000, to show the chart more clearly and have the 5000 line right above not too far away. Thanks !
My code:
[ { borderColor: dataCrack?.data?.find( (el) => el.key === "colorChart" )?.value, data: generateDataChart(), cubicInterpolationMode: "monotone", lineTension: 3, borderWidth: 2.5, segment: segment, spanGaps: true, tension: 0.5, }, { label:
Ngưỡng cao ${dataChart?.station?.split("/")[1]}, data: Array.from({ length: generateDataChart()?.length }, () => Number( dataChart?.dataLow_High && dataChart?.dataLow_High[0]?.value?.split(",")[4] ) ), borderColor: colorHighLow.value, lineTension: 0, borderWidth: 1.5, borderDash: [5, 5], order: 0, },]
Example
No response