[ENHANCEMENT] ScatterChart: make axis and tooltip timezone aware#712
Conversation
Signed-off-by: Andreas Gerstmayr <agerstmayr@redhat.com>
| return formatWithTimeZone(timeStamp, 'MMM yyyy', timeZone); | ||
| } | ||
|
|
||
| // between 10 days to 6 months |
There was a problem hiding this comment.
What happen between 2 years and 6 month ?
There was a problem hiding this comment.
Can you still make a screenshot for this ? if not to complicate
There was a problem hiding this comment.
This is the identical axis formatter as used in the timeseries, heatmap and statushistory charts:
https://github.com/perses/plugins/blob/39a7700a8fd33c1539a1af12b828db35bcdd91d0/timeserieschart/src/utils/timezone-formatter.ts
https://github.com/perses/plugins/blob/39a7700a8fd33c1539a1af12b828db35bcdd91d0/heatmapchart/src/utils/get-formatted-axis-label.ts
https://github.com/perses/plugins/blob/39a7700a8fd33c1539a1af12b828db35bcdd91d0/statushistorychart/src/utils/get-formatted-axis-label.ts
It's a way to make the axis timezone-aware. If the range of the chart is too long it uses years, otherwise months, days, hours etc.
Probably a candidate to move to https://github.com/perses/shared/tree/main/components/src/EChart (including the bug fix below)?
What happen between 2 years and 6 month ?
I think you just discovered a bug in all these charts :D
You're right, it'll fall back to the return statement, which formats it as HH:mm. I fixed it now in this file.
There was a problem hiding this comment.
I created perses/shared#190 to pull this shared code in the perses/shared repo. But we'll need a new release before I can remove it from the plugins here.
Signed-off-by: Andreas Gerstmayr <agerstmayr@redhat.com>
ecc3ebf to
20c7aad
Compare
celian-garcia
left a comment
There was a problem hiding this comment.
Lgtm. The update for alignment can be done later indeed

Description
scatterchart: make axis and tooltip timezone aware
Screenshots
No UI changes, except that the timezone from the TimeRangeSelector is respected.
Checklist
[<catalog_entry>] <commit message>naming convention using one of thefollowing
catalog_entryvalues:FEATURE,ENHANCEMENT,BUGFIX,BREAKINGCHANGE,DOC,IGNORE.UI Changes