Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Shorten the distance between Oy axis values #11935

Open
1 of 3 tasks
CuongSofi opened this issue Oct 21, 2024 · 1 comment
Open
1 of 3 tasks

Shorten the distance between Oy axis values #11935

CuongSofi opened this issue Oct 21, 2024 · 1 comment

Comments

@CuongSofi
Copy link

CuongSofi commented Oct 21, 2024

Documentation Is:

  • Missing or needed?
  • Confusing
  • Not sure?

Please Explain in Detail...

Screenshot 2024-10-21 at 11 31 59

Can you help me with some solutions to shorten the Oy axis when the values ​​are too far apart?

Your Proposal for Changes

Screenshot 2024-10-21 at 11 54 47

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

@LeeLenaleee
Copy link
Collaborator

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants