Start a new topic

Sparkline regression: negative numbers now shown as zero, previously shown as grey bar.

Hi all,


Background:


I wrote an app some time ago to pull data from nightscout for Diabetes blood glucose monitoring.


I'm using a sparkling to draw a graph of blood sugar levels over the last 3 hours.


ChartData and negative numbers


The blood glucose levels aren't always available. Sometimes there are gaps in the data.


I previously included negative numbers in my chartData to show gaps:

 

"chartData": [
                160,
                140,
                120,
                100,
                -160,
                100,
                120,
                100,
                100,
                100,
                100,
                100,
                100,
                100,
                100,
                100,
                100,
                100,
                100,
                100,
                100,
                100,
                100,
                100,
                100,
                100,
                100,
                100,
                100,
                100,
                100,
                100,
                100,
                100,
                100,
                100,
                100
            ]

  

It seemed that there was a feature of the sparkline. negative numbers were rendered as a full height grey bar, without a white pixel at the top:



Here's an example of how this missing data was rendered (note no white pixel in column 5)



This was good, but stopped working recently


I released an update to the app a few days ago, and although the data feed has not changed, the way the graph is rendered has changed:


Now, negative numbers are represented as a white pixel:


This is bad, missing data is now misleading


This makes the graph harder to understand, I can't tell if my blood sugar level is low or if there is a missing entry on the graph.


What would help


Restoring negative numbers being rendered as grey bars (without the white pixel at the top)


It would be awesome if there was a chordate entry I could add that asked the LaMetic to avoid drawing a column:


 

"chartData": [
  160,
  140,
  120,
  100,
  false or null or "NaN" or "LEAVEBLANK",
]

 So that it might be shown as :


Hiding columns in the sparkline would be great!




Login or Signup to post a comment