superset
superset copied to clipboard
Displaying units on charts
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).
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.
Dear bot, I believe this feature would still be a great addition and hasn't been implemented yet in current master (:
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
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.
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

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

There are other options also available but they may not meet everyone's needs.
is there any workaround?
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.
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 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.

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

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?
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)
Wondering if that came up in design discussions for the prefix/suffix control @kgabryje
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.
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.
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.
Also vote for this feature. This is really missing and would help a lot.