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

enhancement: modify the display effect on the xAxis of tooltip charts #792

Merged
merged 9 commits into from
Apr 29, 2024

Conversation

wangyantong2000
Copy link
Collaborator

@wangyantong2000 wangyantong2000 commented Apr 17, 2024

Brief Information

This pull request is in the type of (more info about types):

  • build
  • ci
  • docs
  • feat
  • fix
  • perf
  • refactor
  • test

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.
image

Checklist

Others

@CLAassistant
Copy link

CLAassistant commented Apr 17, 2024

CLA assistant check
All committers have signed the CLA.

@CLAassistant
Copy link

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

Copy link
Member

@tyn1998 tyn1998 left a 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) {
Copy link
Collaborator

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!

Copy link
Collaborator Author

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.

Copy link
Collaborator Author

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。

Copy link
Collaborator

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.

Copy link
Collaborator Author

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.

@wxharry
Copy link
Collaborator

wxharry commented Apr 21, 2024

Please change the title to fix or enhancement. Your contribution are not just a style change, but a great improvement on the UI. Thanks for your efforts and contribution! 😸

@wangyantong2000 wangyantong2000 changed the title style: modify the display effect on the xAxis of tooltip charts enhancement: modify the display effect on the xAxis of tooltip charts Apr 22, 2024
@tyn1998 tyn1998 marked this pull request as ready for review April 29, 2024 03:46
Copy link
Member

@tyn1998 tyn1998 left a 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.

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

Successfully merging this pull request may close these issues.

[Feature] Improvement Suggestion for the xAxis of the Issues Tooltip Chart
4 participants