superset icon indicating copy to clipboard operation
superset copied to clipboard

Displaying units on charts

Open inesmoskal opened this issue 4 years ago • 16 comments

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

inesmoskal avatar Sep 06 '21 17:09 inesmoskal

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[bot] avatar Apr 18 '22 03:04 stale[bot]

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

EBoisseauSierra avatar Apr 19 '22 09:04 EBoisseauSierra

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

grzesuav avatar Jun 29 '22 14:06 grzesuav

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.

mdeshmu avatar Aug 09 '22 00:08 mdeshmu

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 .

YOUSSEFRADYENE avatar Aug 15 '22 14:08 YOUSSEFRADYENE

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.

mdeshmu avatar Aug 16 '22 01:08 mdeshmu

is there any workaround?

novboy avatar Aug 19 '22 05:08 novboy

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.

sfirke avatar Sep 23 '22 17:09 sfirke

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.

GerbenvdHuizen avatar Oct 18 '22 14:10 GerbenvdHuizen

@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

mdeshmu avatar Oct 18 '22 15:10 mdeshmu

@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

simonvanderveldt avatar Oct 20 '22 12:10 simonvanderveldt

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?

pawar-kapil avatar Feb 25 '23 11:02 pawar-kapil

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 avatar Feb 23 '24 18:02 rusackas

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

rusackas avatar Feb 23 '24 18:02 rusackas

This might be closed as stale, if nobody wants to take up anything on this thread as an improvement in Superset. CC @kasiazjc @yousoph to see if they want to take any inspiration from the Grafana screenshot or anything else discussed herein.

rusackas avatar Jul 09 '24 20:07 rusackas

Howdy, folks - I'd be happy to take a stab at this, at least for the Big Number control. As a first time contributor, where and what types of changes would I be looking to do? Particularly looking for where the various number formats/prefixes/suffixes are defined.

Preskton avatar Oct 11 '24 18:10 Preskton

Vote for this feature!!! Our clients are world wide. This is a high demand feature from our internal customers to switch unit, i.e. from imperial to metric. It will be very cumbersome to work around and implement such conversion in a converted dataset in the same dashboard for >100 tables. Such unit conversion feature has been frequently brought up from our internal customers in the past 2 years.

joannren avatar Nov 28 '24 22:11 joannren

Also vote for this feature. This is really missing and would help a lot.

Schnurres avatar Jan 09 '25 21:01 Schnurres