HighStock, if the missing inert moment in time shows a red line or empty space?

Hey. I used a table with a lot of headroom to display the data in time series format. I was getting data every 5 minutes, for the X axis I set a timestamp which I got every 5 minutes. but in case some data won't come from 5 minutes then i want to display this line in red

or blank

below i have tried

JsFiddle link

This demo data comes in at 10:25 am and after 10:35 am, so I want to show a red line or blank space in between. The following images show the expected output

enter image description here

Or

      

enter image description here

+2


source to share


1 answer


I think the problem here is, how are high priorities supposed to know that there is no data at 10:30? The data timestamp intervals are not identical (which means they don't appear every 5 minutes).

What you can do is set up an observer function that will receive the data first. There is a timer set inside this, which if 5 minutes pass without any fetched data, send a data point for example [<the time stamp>, null]

. Now you also need a property to not tie nulls called connectNulls

. This is not correct by default, so your second option above works (see fiddle ).

For option 1 (red line), you will need to create a new series containing the previous point and the next point surrounding your no data point, and set its gray color to red. The downside here is that if you have a lot of cases with data gaps, you will create a lot of two-point series. An example adding example:



{
    color: 'red',
    showInLegend: false,
    data: [
    [1415787839488, 0.5590000152587891],
    [1415788494848, 0.5139999985694885]
        ]
}

      

And a fiddle example .

+3


source







All Articles