Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

highcharts with null data points

Tags:

highcharts

I have a question regarding highcharts, I'm generating a graph and sometimes the backend returns null for some days.

Json: {"series":[{"id":548,"data":[null,1287.5,null,186.7777,null,null,null],"name":"Example"}],"categories":["May 04","May 05","May 06","May 07","May 08","May 09","May 10"]}

Im getting a graph like this enter image description here

Which I think is completely fine. The requirement changed and the customer doesn't like to see it like this, he wants to have the two points liked by a line. I told him that it will give the impression of false data for the date in the middle, he said that he wants data but no point in the middle.

Is this possible?, I couldn't fine anything like that on the documentation. In this case to put 0 instead of null is not possible because of the nature of the data.

like image 627
Alejandra Avatar asked Dec 07 '22 01:12

Alejandra


1 Answers

Simply set connectNulls: true, see API.

like image 174
Paweł Fus Avatar answered Jan 03 '23 19:01

Paweł Fus