line graph - draw only when values exists (or not 0)

17 views
Skip to first unread message

Shprung

unread,
Feb 28, 2018, 1:53:13 PM2/28/18
to Google Visualization API
How can you configure/set-options in order to get a line graph where you only see visuals where you have data.
See my images for better comparison between what I am getting now, and what is my goal.

Example data may be:
[25,0,30,0,0,0,0,0,0,0,0], [26,0,28,0,0,0,0,0,0,0,0], [27,0,0,0,26,0,0,0,0,0,0], [28,0,0,0,30,0,0,0,0,0,0], [29,0,0,0,0,30,0,0,0,0,0],
[30,0,0,0,0,31,0,0,0,0,0],
I tried sending no data, something like [25,,30,,,,,,,,]
But it results in an error; Can G-Visualization line graph can be setup to do it?
Untitled-2.png

Daniel LaLiberte

unread,
Feb 28, 2018, 4:05:34 PM2/28/18
to Google Visualization API
You can use null values where you have no data.  The undefined values should also work, but you have to be careful about the last element, since the last extra comma is now eliminated by JavaScript.

Then you probably want to also set the interpolateNulls option to true.

--
You received this message because you are subscribed to the Google Groups "Google Visualization API" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-visualization-api+unsub...@googlegroups.com.
To post to this group, send email to google-visualization-api@googlegroups.com.
Visit this group at https://groups.google.com/group/google-visualization-api.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-visualization-api/3c4ac7d7-a946-4b29-a124-a4836539d25a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Reply all
Reply to author
Forward
0 new messages