Google chart API: is it possible to have an incomplete chart?

I need to make a chart showing the weekly activity for the current week, with each day of the week being a point on the X axis. Example:

enter image description here

This works great, but the problem I ran into is that if there was Wednesday today, then there is no data for Thursday-Saturday. Currently, the chart shows this by sending the row back to 0. Is there a way to make Google Charts stop drawing the line at a specific point and leave the rest of the data points empty?

I tried to skip missing values ​​from the dataset, but that just makes it stretch Sunday-Wednesday across the entire chart.

+4
source share
1 answer

You need to pass a null value, which is the Javascript way to express nil . Make sure you do not include quotation marks.

For instance:

 ["Sat", null, 165, 210] 
+4
source

Source: https://habr.com/ru/post/1368994/


All Articles