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

[Bug]: Tabular Data and Tooltip only show date level precision #1468

Open
naegelin opened this issue Nov 18, 2022 · 1 comment
Open

[Bug]: Tabular Data and Tooltip only show date level precision #1468

naegelin opened this issue Nov 18, 2022 · 1 comment
Assignees
Labels
type: bug 🐛 Something isn't working

Comments

@naegelin
Copy link

naegelin commented Nov 18, 2022

What happened?

This is a continuation of #1400 which I believe to be a bug.

Issue 1: When defining a scaletype of time in axis options and the data passed into the chart is indeed date+time, the tooltip helper used on several charts will only show Date level granularity formatting. When using higher granularity time series (hourly, minute, etc) this becomes problematic as the tooltip will only ever just display the current date in the following format: MMM d, yyyy .

An example of this can be seen here:
https://codesandbox.io/s/5v1s9b?file=/App.svelte
Notice the granularity of the data is hourly but the tooltip displays only the date.

The issue in code is in two locations:
https://github.com/carbon-design-system/carbon-charts/blob/master/packages/core/src/components/essentials/tooltip.ts#L253

and

https://github.com/carbon-design-system/carbon-charts/blob/master/packages/core/src/components/essentials/tooltip.ts#L259

Issue 2: When defining a scaletype of time in axis options and the data passed into the chart is indeed date+time, the tabular representation made available by several charts will again only show Date level granularity. This means viewing hourly, minute-by-minute,etc data in the table representation is not possible because the values are again formatted as MMM d, yyyy .

An example of this can again be seen here:
https://codesandbox.io/s/5v1s9b?file=/App.svelte
Clicking on the tabular representation button will show that the table only displays the date even though the data is hourly.

The issue in code is in the following locations
https://github.com/carbon-design-system/carbon-charts/blob/master/packages/core/src/components/essentials/tooltip.ts#L259

I propose changing the formatting in all three places to 'MMM d, yyyy HH:mm:ss' in order to properly represent up to second level precision in these two features.

Version

@carbon/charts@master

Data & options used

No response

Relevant log output

No response

Codesandbox example

https://codesandbox.io/s/5v1s9b?file=/App.svelte

@naegelin naegelin added the type: bug 🐛 Something isn't working label Nov 18, 2022
@naegelin naegelin mentioned this issue Nov 18, 2022
8 tasks
@naegelin
Copy link
Author

As mentioned in #1400. Downloading to CSV also removes the original values of the time data, making the export meaningless for any granularity below Day.

See screenshot of bug here

@theiliad theiliad moved this to ⏱ Backlog in @carbon/charts Aug 23, 2023
@theiliad theiliad moved this from ⏱ Backlog to Todo in @carbon/charts Aug 23, 2023
RiyaJethwa added a commit to RiyaJethwa/carbon-charts that referenced this issue Oct 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug 🐛 Something isn't working
Projects
Status: Todo
Development

Successfully merging a pull request may close this issue.

2 participants