question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Bar chart continues with previous value if currently no value is available

See original GitHub issue

Hi,

i’m currently creating a bar graph with daily metrics. So one bar per day with the last value. But some value are not available at the start of the day… I would expect that the bar chart then does not show any bar for this day till the value is available. But sadly it just copies the previous value for the chart. In the legend i see NaN as expected.

Here is my graph card

type: 'custom:mini-graph-card'
entities:
  - sensor.daily_sensor
name: Daily_sensor
hours_to_show: 240
aggregate_func: last
lower_bound: 0
upper_bound: 200
hour24: true
icon: none
show:
  labels: false
  graph: bar
group_by: date
color_thresholds:
  - value: 0
    color: '#32CD32'
  - value: 35
    color: '#FFD700'
  - value: 50
    color: '#FF0000'
  - value: 100
    color: '#660000'

image

Also i hover over the current bar (where no value is available) it shows the value of the day before image

Do you have any ideas how i can make the graph not showing a bar if the value is not yet available?

Thanks

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:7 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
eloocommented, Oct 28, 2020

Hi,

ah okay… i see the problem. The problem here is that if i set it to 0 its not correct… because 0 would be a valid value but i don’t have any value. Currently i’m resetting my sensor to an empty value at midnight. But i can also use NaN or None or whatever. Any non integer value AFAIK.

What i would expect is to simply draw no bar… just an “empty placeholder” till the value is available. Maybe you make the “use_last_value” configurable? to something like “empty value” or “skip” or something else?

Do you think such a change is possible?

I’ve checked quickly the utility_meter but this also doesn’t fit my use-case. As the value is not an increase or decrease value .

More or less i receive a kind of random value for each day. And i don’t want to display any other value till the value is available.

Thanks

0reactions
jlsjonascommented, Jan 23, 2022

Duplicate of #366

Read more comments on GitHub >

github_iconTop Results From Across the Web

A Complete Guide to Bar Charts | Tutorial by Chartio
Bar charts are a fundamental visualization for comparing values between groups of data. Use this guide to learn how to get the most...
Read more >
Blank cells show up as zeros in chart - Microsoft Community Hub
Hello, I'm taking simple averages of my data (e.g. =AVERAGE(B3:Q3)) and then plotting them as a line in a scatter plot. However, there...
Read more >
Creating a chart in Excel that ignores #N/A or blank cells
Now make your plot with your new column and Excel ignores #N/A value and will not plot them as zeroes. Important: do not...
Read more >
How to suppress 0 values in an Excel chart - TechRepublic
This method has little to no impact. For the most part, the chart treats the 0 values as if they're still there, because...
Read more >
No Data showing Gap in line chart
If you'd like to keep the line to be straight and continuous even the actual value is null, that means the specific day...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found