Error drawing Gantt chart when data comes from query

36 views
Skip to first unread message

Leif C. Forer

unread,
Apr 6, 2020, 7:14:27 PM4/6/20
to Google Visualization API
I'm trying to draw a Gantt chart and query the Data Table from a Google Sheet.

The Gantt chart draws successfully when I hardcode the Data Table in the Javascript. Here's a working jsfiddle with hardcoded data: https://jsfiddle.net/lforer/h7Lkxe1r/latest/

I can also successfully query the Google Sheet and display selected data in a table. Here's a working jsfiddle with data queried from the Google Sheet: https://jsfiddle.net/lforer/mzdvrx0t/latest/

Here's the jsfiddle that I thought would work but generates an error: https://jsfiddle.net/lforer/724os3tg/latest/

I suspect the problem may be related to the date and null values in the Google Sheet. Has anyone encountered this before? Any ideas about how to fix or debug?

With thanks,
~Leif

Daniel LaLiberte

unread,
Apr 6, 2020, 10:10:56 PM4/6/20
to Google Visualization API
The string "null" is not the same as a null value.  Try removing that string from the cell.   Also check that your dates are actually date values and not just strings that look like dates.

Here is your data in a Table, to see what comes through:   https://jsfiddle.net/dlaliberte/zjyq9mu1/3/

--
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-visualizati...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-visualization-api/db31c6e3-a8eb-4e85-874f-41388e66d7fe%40googlegroups.com.


--

Leif C. Forer

unread,
Apr 7, 2020, 8:20:32 AM4/7/20
to google-visua...@googlegroups.com
Thanks for the ideas Daniel. I removed null strings and used the Google Sheets default date format for date cells. Got a new error about column 5 datatype needing to be number -- column 5 was formatted for number but contained no values. I added a dummy value to the first column 5 row 1 and, voila, the chart draws. Here's the working jsfiddle for anyone with similar issues: https://jsfiddle.net/lforer/724os3tg/latest/

You received this message because you are subscribed to a topic in the Google Groups "Google Visualization API" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/google-visualization-api/Tm8k_L6cvLQ/unsubscribe.
To unsubscribe from this group and all its topics, send an email to google-visualizati...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-visualization-api/CAOtcSJOpu7j%3Dsp%2B77QBuHxoumwnJkvXkqnxF0_02_nMbObyi1Q%40mail.gmail.com.
Reply all
Reply to author
Forward
0 new messages