-
Notifications
You must be signed in to change notification settings - Fork 102
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
enhancement: modify the display effect on the xAxis of tooltip charts #792
enhancement: modify the display effect on the xAxis of tooltip charts #792
Conversation
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @wangyantong2000, great job!
}; | ||
const startValue = params.batch[0].start; | ||
let minInterval: number; | ||
if (startValue != 0) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi, @wangyantong2000. I am not sure this works, because the startValue seems like the start point on the Axis that are showed when zooming. It is not related to the interval. Could you explain more in details on how this works? Thanks for you work!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
StartValue represents the percentage of the starting position for scaling. When it is not equal to 0, it means that it is not in the initial state and is performing a scaling action, setting minInterval to the month. When it is equal to 0, set minInterval to year.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I made further changes. StartValue represents the percentage of the starting position for scaling. EndValue represents the percentage of the end position of scaling. When startValue equals 0 and endValue equals 100, it indicates that it is in the initial state and minInterval is set to the year. Otherwise, it means that a scaling or dragging action has been taken and minInterval has been set to the month。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see what you mean. But this cannot fix the issue essentially. An example could be this new repo MetaGPT. It is a newly created project and it doesn't have years' of records, the axis labels are missing because we set the minInterval
to year.
The idea to change the minInterval
should be fine, but we need to find some other attributes in options or do calculation on the startValue/endValue to know when to change the value.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, I didn't consider everything thoroughly. Thank you for your reminder. I will make corrections.
Please change the title to |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks for your contribution! @wangyantong2000
Yet apparently there are repeated code in these components, which we should consider refactoring later.
Brief Information
This pull request is in the type of (more info about types):
Related issues (all available keywords):
Details
When the time interval between the starting point and the ending point is long, the effect is as follows.
iShot_2024-04-29_21.19.51.mp4
When the time interval between the starting point and the ending point is short, the effect remains the same as before, and the effect is as follows.
Checklist
Others