Skip to content

Commit

Permalink
Add treemap support
Browse files Browse the repository at this point in the history
  • Loading branch information
Nelson Silva committed Sep 23, 2015
1 parent a111f44 commit 63e6c5a
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 3 deletions.
36 changes: 36 additions & 0 deletions demo/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -353,5 +353,41 @@ <h2>Chart gallery</h2>
}, 3000);
</script>

<p>Here's a treemap:</p>

<google-chart
type="treemap"
options='{"showScale": true, "maxPostDepth": 2}'
data='[["Location", "Parent", "Value"],
["Global", null, 0],
["America", "Global", 0],
["Europe", "Global", 0],
["Asia", "Global", 0],
["Australia", "Global", 0],
["Africa", "Global", 0],
["Brazil", "America", 11],
["USA", "America", 52],
["Mexico", "America", 24],
["Canada", "America", 16],
["France", "Europe", 42],
["Germany", "Europe", 31],
["Sweden", "Europe", 22],
["Italy", "Europe", 17],
["UK", "Europe", 21],
["China", "Asia", 36],
["Japan", "Asia", 20],
["India", "Asia", 40],
["Laos", "Asia", 4],
["Mongolia", "Asia", 1],
["Israel", "Asia", 12],
["Iran", "Asia", 18],
["Pakistan", "Asia", 11],
["Egypt", "Africa", 21],
["S. Africa", "Africa", 30],
["Sudan", "Africa", 12],
["Congo", "Africa", 10],
["Zaire", "Africa", 8]]'>
</google-chart>

</body>
</html>
8 changes: 5 additions & 3 deletions google-chart.html
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@
*
* Should be one of:
* - `area`, `bar`, `bubble`, `candlestick`, `column`, `combo`, `geo`,
* `histogram`, `line`, `pie`, `scatter`, `stepped-area`
* `histogram`, `line`, `pie`, `scatter`, `stepped-area`, `treemap`
*
* See <a href="https://google-developers.appspot.com/chart/interactive/docs/gallery">Google Visualization API reference (Chart Gallery)</a> for details.
*
Expand Down Expand Up @@ -297,7 +297,8 @@
'scatter': google.visualization.ScatterChart,
'stepped-area': google.visualization.SteppedAreaChart,
'table': google.visualization.Table,
'gauge': google.visualization.Gauge
'gauge': google.visualization.Gauge,
'treemap': google.visualization.TreeMap
};
},

Expand All @@ -316,7 +317,8 @@
'scatter': 'corechart',
'stepped-area': 'corechart',
'table': 'table',
'gauge': 'gauge'
'gauge': 'gauge',
'treemap': 'treemap'
};
},

Expand Down

0 comments on commit 63e6c5a

Please sign in to comment.