Set null legend values per series?
See original GitHub issueHi, is there any way to set a custom null legend value for a series? If the mouse is not hovering over the chart, the legend shows --
which, as far as I can tell, is hard coded here:
https://github.com/leeoniya/uPlot/blob/d12f84b9daf770ea9b04d42e04ee9738ca055024/src/uPlot.js#L556
I would like the legend to show a different default value that is different per series. In my case for example I would like to render the sum of all data for a series. I can calculate the value myself of course, I’m just not sure how to render it in place of the --
while keeping the mouse over live legend functionality.
Thank you very much!
Issue Analytics
- State:
- Created 2 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
Null values are displayed in the legend if there a... - 1668361
Hi All,. I have a Bar chart in that having 3 Dimensions and measure. If values are null then display the Null values...
Read more >Hiding "Series1" from chart legend when values are null
Any NULL values for the column "Type" are showing on the legend as "Series1" while the other values show as they should
Read more >How to hide zero or null values in Legend in Grafana 8?
Hide null values and zero values from Legend in my Panel How are you ... hide series with 0/null values sort tooltip entries...
Read more >Option to hide zero values in legend and tooltip · Issue #1381
The new options to hide null values in the legend and 'all series' tooltip are excellent but I run into a problem when...
Read more >Metrics Dashboard: Hide series with only nulls/zeros in legend
Summary Grafana charts have an option to hide charts that have null or zero values. This is especially useful in cases...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
ah, ok.
i’ll see about adding something that invokes
series.value()
with anull
idx during data updates and cursor hiding events.Thank you for your quick reply. I tried that and as far as I can tell it only is called when actually hovering, not for the case where the user is not hovering, which is the “null legend” case I tried to describe. Maybe my question wasn’t clear though so I’ll try to rephrase:
When the mouse is not over the chart, the value in the legend for every series is shown as
--
(see screenshot below). Returning a value from thevalue:
function does influence the legend, but only when hovering over a specific x point. The hovering already works fine without customization though.What I would want is a function on the series that gets all data points for the currently visible part of the x axis (which can change when the user zooms in) and whatever it returns is rendered in the legend when the user is not hovering the chart, replacing the
--
. In this specific case I would use it to sum the value of all points.Thank you again.