-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
[charts] Improve docs about how to pick the correct scaleType #13658
Comments
Component: LineChart |
Here is the solution: https://codesandbox.io/p/sandbox/graph-axis-name-forked-2ccmkc?file=%2Fsrc%2FApp.tsx%3A162%2C13 1. pick the correct scale
You need to accept any king of number. Then I would recommend to use the default scale ( 2. fix the ticksNow the axis is doing its best to show meaning full ticks. Since it goes from 0 to 1200 it is proposing 0, 200, 400, 600, 800, 1000, 1200. But we have labels for 100, 300, 600, 800, 1000, 1200. The solution is to specify in the axis definition If that does solves your issue, please consider closing it |
@alexfauquette, Oh, thank you very much! I have some more questions though, why the line Is there any way to increase the distance between the "tickLabel"? I got it like this (the first and the second are quite close to each other): Ideally, I'd like to have equal distance between "tickLabel" despite the difference in values. This should work: |
That does not sound feasible. Do have that you would need to create your own weird scale type. Where you can end up with moving for 0 to 100px represent an increase of 50, and moving from 100px to 200pc represent an increase of 236 You have two standard alternatives: If the data does not represent something linear you can try the The other option is to display all the tick and show labels only on the meaning full one
Your y-axis probably still have a |
With
Yes, my axis has |
Not for now. Those highlight lines are here to show axis values, and not points. To do it, you will probably need to use |
@CzarOfScripts: How did we do? Your experience with our support team matters to us. If you have a moment, please share your thoughts in this short Support Satisfaction survey. |
Steps to reproduce
Link to live example: codesandbox.io
Steps:
Current behavior
I apologize for the English, I use a translator and in general I don't really understand how to correctly formulate the problem and its solution, but after watching the demonstration I think the problem and what I was trying to achieve will be clear.
My task is to make custom Labels for yAxis, and the problem is that I can't create a point that will be between two "labels", i.e. there is a label "Mid Developer" which has a value of "300" and there is a "Senior Developer" which has a value of "600". If I want to create a point that has the value "350" (i.e. between the two labels), the point will simply not be drawn and the chart will break (the points will not connect).
In the variant where we do not specify explicitly (or specify all that we can have) what values will be in
data
for yAxis, then there is a separate "tick" for this value, which would not be desirable.Expected behavior
I wanted the point to be placed in between the "tick" without creating a new "tick" for itself.
Context
I wanted the point to be placed in between the "tick" without creating a new "tick" for itself.
Your environment
I'm use Google Chrome (126.0.6478.127)
npx @mui/envinfo
Search keywords: I'm sorry, it's hard for me to articulate the problem
The text was updated successfully, but these errors were encountered: