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.

Bands with null values incorrectly rendered

See original GitHub issue

I’m trying to create a line chart with min/max bands that don’t exist for all points (=> set to null values). However I’m seeing some weird fillings: grafik (Please ignore the fact that min/max values aren’t actually min/max all the time, that’s a different problem on my side I still need to fix)

The point is that I don’t expect the green band at the last few points that have null low/high values. Any idea about that?

For reference, here’s the code I’m using to create the plot:

opts = {
  title: "Temperature",
  id: "chart1",
  class: "my-chart",
  width: 400,
  height: 300,
  tzDate: ts => uPlot.tzDate(new Date(ts), 'Etc/UTC'),
  series: [
    {},
    {
        label: "Low",
        stroke: "green",
    //	fill: "rgba(0, 0, 0, .07)",
        value: (u, v) => v + "°C",
        width: 1,
    },
    {
        label: "High",
        stroke: "red",
        value: (u, v) => v + "°C",
        width: 1,
    },
    {
        label: "Avg",
        stroke: "blue",
        width: 2,
        value: (u, v) => v + "°C",
    }
  ],
  bands: [
        {
            series: [2,3],
            fill: "rgba(255,0,0,0.1)",
        },
        {
            series: [3,1],
            fill: "rgba(0,255,0,0.1)",
        }
    ],
    scales: {
        x: {
        //	dir: -1,
        //	ori: 1,
        },
        y: {
        //	dir: -1,
        //	ori: 0,
        },
    },
    axes: [
        {
        //	side: 3
        },
        {
        //	side: 2,
            values: (u, vals) => vals.map(v => v + "°C")
        }
    ]
};
let uplot = new uPlot(opts, data, node);

data is an array containing 4 arrays in [time, low, high, avg] order. The arrays are of equal length and low/high have an equal number of null values at the end. The timestamps are in increasing order.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:10 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
Christian-Sandercommented, Sep 27, 2021

Looks good to me now! Tested on Firefox and Edge.

0reactions
leeoniyacommented, Oct 9, 2021

ok, should be fixed.

let’s see how many more times i have to re-close this one 🤣

Read more comments on GitHub >

github_iconTop Results From Across the Web

Render bands / bandData in jqplot when series contains null ...
My does data have some missing values. Is there any way to make the bands render for non-null data points on the line,...
Read more >
GEE Tile error: Expected a homogeneous image collection ...
That error means that not all bands in your ImageCollection are of the same type. Try casting them to float: var addNDVI =...
Read more >
Debugging guide | Google Earth Engine
The first error informs you that the bandNames variable is not defined in the scope in which it's referenced. As a solution, set...
Read more >
What Makes a Contract Null and Void? These Mistakes Do.
When a contract is void, it's unenforceable because it's missing one of the required elements of a legal agreement. And there's no point...
Read more >
Variable calculation is NULL when using returned values from ...
I see that in your case, you try to display the sum in the summary band, which follows the detail band where subreports...
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