Google Cloud Datalabのチャート実行メモ

#はじめに

Google Cloud Datalabで使用できるチャートについて公式では視覚的にわからなかったので実行メモ。

公式
<https://googledatalab.github.io/pydatalab/google.datalab%20Commands.html>

#元データ
```sql
%%bq query --name total_births
SELECT 
  CAST(source_year AS string) AS year, 
  COUNT(is_male) AS birth_count
FROM `publicdata.samples.natality`
  GROUP BY year
ORDER BY year DESC
LIMIT 15
```

#annotation
```
%chart annotation --fields year,birth_count --data total_births
```
<font color="Red">エラー：First column must contain date, or date and time.　</font>

#area
```
%chart area --fields year,birth_count --data total_births
```
![image.png](https://qiita-image-store.s3.amazonaws.com/0/297571/698c4033-961d-2f60-ab4d-6cec2d2826fd.png)

#bubbles
```
%chart bubbles --fields year,birth_count --data total_births
```
<font color="Red">エラー：Data table should have at least 3 columns</font>

#calendar
```
%chart calendar --fields year,birth_count --data total_births
```
<font color="Red">エラー：id data table format: column #0 must be of type'date|datetime'.</font>

#columns
```
%chart columns --fields year,birth_count --data total_births
```
![image.png](https://qiita-image-store.s3.amazonaws.com/0/297571/81d1e247-e7e7-79d8-e90c-0c9653426596.png)

#combo
```
%chart combo --fields year,birth_count --data total_births
```
![image.png](https://qiita-image-store.s3.amazonaws.com/0/297571/5d07c2f7-2af0-e479-e0b0-ea2b3bad1121.png)

#geo
```
%chart geo --fields year,birth_count --data total_births
```
![image.png](https://qiita-image-store.s3.amazonaws.com/0/297571/65eb03c8-7bf0-8d0b-f4bd-5d7496ce3e04.png)

#heatmap
```
%chart heatmap --fields year,birth_count --data total_births
```
![image.png](https://qiita-image-store.s3.amazonaws.com/0/297571/0eee28b0-9c5e-f021-5c0e-7ac7219623f8.png)

#line
```
%chart line --fields year,birth_count --data total_births
```
![image.png](https://qiita-image-store.s3.amazonaws.com/0/297571/04a0b79a-2c12-6a9f-07b4-7bdfed7aa257.png)

#map
```
%chart map --fields year,birth_count --data total_births
```
![image.png](https://qiita-image-store.s3.amazonaws.com/0/297571/bee82004-00cb-4198-afbc-d6fe96935b7e.png)

#org
```
%chart org --fields year,birth_count --data total_births
```
![image.png](https://qiita-image-store.s3.amazonaws.com/0/297571/7ef21277-526b-a30c-30bd-6b22e15f63a4.png)

#paged_table
```
%chart paged_table --fields year,birth_count --data total_births
```
![image.png](https://qiita-image-store.s3.amazonaws.com/0/297571/c10426ca-bb56-f0d6-36c0-b3469b4594b4.png)

#pie
```
%chart pie --fields year,birth_count --data total_births
```
![image.png](https://qiita-image-store.s3.amazonaws.com/0/297571/f2818631-fa63-037d-6fcd-5d0eb3d01539.png)

#sankey
```
%chart sankey --fields year,birth_count --data total_births
```
<font color="Red">エラー：id data table format: must have at least 3 columns.</font>

#scatter
```
%chart scatter --fields year,birth_count --data total_births
```
![image.png](https://qiita-image-store.s3.amazonaws.com/0/297571/06917ee8-f0ed-acb9-b2fb-20a7b9ca4810.png)

#stepped_area
```
%chart stepped_area --fields year,birth_count --data total_births
```
![image.png](https://qiita-image-store.s3.amazonaws.com/0/297571/6b98f7c1-2257-7500-95a2-6d28a4ed41ac.png)

#table
```
%chart table --fields year,birth_count --data total_births
```
![image.png](https://qiita-image-store.s3.amazonaws.com/0/297571/dbd78636-0dc9-988c-7bd1-9062df04ac7e.png)

#timeline
```
%chart timeline --fields year,birth_count --data total_births
```
<font color="Red">エラー：id data table format: must have 3 or 4 data columns.</font>

#treemap
```
%chart treemap --fields year,birth_count --data total_births
```
<font color="Red">エラー：lumn 1 must be of type string</font>