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

Displaying units on charts #16610

Open
inesmoskal opened this issue Sep 6, 2021 · 14 comments
Open

Displaying units on charts #16610

inesmoskal opened this issue Sep 6, 2021 · 14 comments

Comments

@inesmoskal
Copy link

inesmoskal commented Sep 6, 2021

Is your feature request related to a problem? Please describe.
When creating a chart, I would like to be able to specify the unit of the numbers plotted. For example to add the unit °C to the Y-axis values of a temperature over time chart created with the Time Series Line chart.
Currently when customising numbers on charts it’s only possible to change the NUMBER FORMAT or Y/X AXIS FORMAT, which is limited to features built-in in the d3-format. This formatting doesn't allow for pre/suffixes. So in my situation I can chose to display 37 or 37.6, but I can't display 37.6 °C.

Would it be possible to introduce an additional option, which would allow to add a prefix and/or suffix to the numbers on charts? This would be useful for the static numbers and when hovering over the chart, also in most of the current existing charts.

Describe the solution you'd like
Most convenient from my perspective would be to define the unit for specific columns at database level by adding an additional box in the Edit Dataset pop up (just like it's already the case for the time dimensions). That would allow to automatically see the pre/sufix without repeating the process on each chart.

Describe alternatives you've considered
Another solution would be to specify prefix and/or suffix alongside the D3 number formatting. This could be using the same input box, via a syntax like <my_prefix>{actual D3 formatting}<my_suffix> (e.g. {,.2f} °C).

@stale
Copy link

stale bot commented Apr 18, 2022

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. For admin, please label this issue .pinned to prevent stale bot from closing the issue.

@stale stale bot added the inactive Inactive for >= 30 days label Apr 18, 2022
@EBoisseauSierra
Copy link
Contributor

Dear bot, I believe this feature would still be a great addition and hasn't been implemented yet in current master (:

@stale stale bot removed the inactive Inactive for >= 30 days label Apr 19, 2022
@grzesuav
Copy link

My use case is - I want to display bytes (how much memory my applications are using) and now it is misleading when it format it like 14T which isn't accure

@mdeshmu
Copy link
Contributor

mdeshmu commented Aug 9, 2022

I want to display bytes (how much size an s3 prefix is using) and now it is misleading when it format it in billion or trillion like 900B or 1.5T which isn't accurate.

@YOUSSEFRADYENE
Copy link

I have the same issue with changing the format or letter that define the unit in the end of a big number visualization which isn't accurate
Screenshot_20220815_151737

Screenshot_20220815_151634
.

@mdeshmu
Copy link
Contributor

mdeshmu commented Aug 16, 2022

I found this formatter in customize tab of Line chart which helped me achieve byte conversion with right units.

image

There are other options also available but they may not meet everyone's needs.

@novboy
Copy link

novboy commented Aug 19, 2022

is there any workaround?

@sfirke
Copy link
Contributor

sfirke commented Sep 23, 2022

Being able to add prefix/suffix strings would be nice and is a feature found in other BI tools, e.g., Metabase and Tableau. My use case is for Big Number charts, sounds like others would want it in tables and chart axes too.

@GerbenvdHuizen
Copy link

We are moving a few of our monitoring charts from Grafana to Superset dashboards and would like to see proper support for units like Grafana has. At the moment we can’t for example show Terrabytes or Gigabytes.

@mdeshmu
Copy link
Contributor

mdeshmu commented Oct 18, 2022

@GerbenvdHuizen I was able to show Terrabytes or Gigabytes in one of our line charts using Y-Axis format as shown in this snippet. Hope this helps.

image

@simonvanderveldt
Copy link

simonvanderveldt commented Oct 20, 2022

@mdeshmu Whilst that technically answers a specific version of this question it's not really comparable to Grafana, where pretty much all units you'll ever need are all present and easily selectable (and you can also add a custom unit if need be).
image

@pawar-kapil
Copy link

There is a concept of adaptive formatting that shows 'B' in place of 'G'. However, this returns plain numbers and there seems to be no way to make it return any icon that we might want, such as '$'. How can we achieve this?

@rusackas
Copy link
Member

Prefix/suffix for currencies has been added to many charts. We can potentially add more options to make it more generic, e.g. having "Currencies" be one option, alongside others (e.g. filesize, measurements, arbitrary string, etc)

@rusackas
Copy link
Member

Wondering if that came up in design discussions for the prefix/suffix control @kgabryje

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

No branches or pull requests