Skip to content

Commit bc427cb

Browse files
committed
Adds the Material Bar chart.
1 parent 179d480 commit bc427cb

2 files changed

Lines changed: 10 additions & 1 deletion

File tree

demo/index.html

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,11 @@
2929
cols='[{"label": "Data", "type": "string"},{"label": "Value", "type": "number"}]'
3030
rows='[["Something", 1]]'></google-chart>
3131

32+
<google-chart
33+
type="md-bar"
34+
cols='[{"label": "Data", "type": "string"},{"label": "Value", "type": "number"}]'
35+
rows='[["Something", 1]]'></google-chart>
36+
3237
<p>Charts can be resized with CSS, but you'll need to call the <code>drawChart</code> method when the size changes.</p>
3338
<p>Here's a basic responsive example using only CSS and JS (You could also use <code>&lt;iron-media-query&gt;</code>):</p>
3439

google-chart-loader.html

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,10 @@
1818
'bar': {
1919
ctor: 'BarChart',
2020
},
21+
'md-bar': {
22+
ctor: 'Bar',
23+
pkg: 'bar',
24+
},
2125
'bubble': {
2226
ctor: 'BubbleChart',
2327
},
@@ -128,7 +132,7 @@
128132
const chartData = CHART_CONSTRUCTORS[type];
129133
return this._load([chartData.pkg || DEFACTO_CHART_PACKAGE])
130134
.then(pkgs => {
131-
return pkgs[0][chartData.ctor];
135+
return google[type.startsWith('md-') ? 'charts' : 'visualization'][chartData.ctor];
132136
});
133137
},
134138

0 commit comments

Comments
 (0)