Search code examples
google-cloud-datalab

Charts drawn with %%chart command do not render


I have this query (a modified version of the query under the Line Chart section of the Datalab Tutorials notebook.)

`%%sql --module timeseries
SELECT HOUR(timestamp) AS timestamp, AVG(latency) AS latency,
FROM [cloud-datalab-samples:httplogs.logs_20140615]
WHERE endpoint = 'Popular'
GROUP BY timestamp`

followed by this call to %%chart

%%chart bars --fields timestamp,latency --data timeseries

but this doesn't seem to draw the required bar chart, even though I do not receive any error message. Am I missing something?


Solution

  • It should be '--field', not '--fields', and there is no '--data'. So try:

    %chart bars --field timestamp,latency timeseries
    

    When I used your version, I did get an error message about 'too many data arguments', because the line parser tried to parse both '--data' and 'timeseries' as the positional data argument.