OLD | NEW |
1 <link rel="import" href="../polymer/polymer.html"> | 1 <link rel="import" href="../polymer/polymer.html"> |
2 <link rel="import" href="../iron-ajax/iron-ajax.html"> | 2 <link rel="import" href="../iron-ajax/iron-ajax.html"> |
3 <link rel="import" href="../google-apis/google-legacy-loader.html"> | 3 <link rel="import" href="../google-apis/google-legacy-loader.html"> |
4 | 4 |
5 <!-- | 5 <!-- |
6 `google-chart` encapsulates Google Charts as a web component, allowing you to ea
sily visualize | 6 `google-chart` encapsulates Google Charts as a web component, allowing you to ea
sily visualize |
7 data. From simple line charts to complex hierarchical tree maps, the chart eleme
nt provides a | 7 data. From simple line charts to complex hierarchical tree maps, the chart eleme
nt provides a |
8 number of ready-to-use chart types. | 8 number of ready-to-use chart types. |
9 | 9 |
10 <google-chart | 10 <google-chart |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
69 * @param {object} detail | 69 * @param {object} detail |
70 * @param {array} detail.selection The user-defined selection. | 70 * @param {array} detail.selection The user-defined selection. |
71 */ | 71 */ |
72 | 72 |
73 properties: { | 73 properties: { |
74 /** | 74 /** |
75 * Sets the type of the chart. | 75 * Sets the type of the chart. |
76 * | 76 * |
77 * Should be one of: | 77 * Should be one of: |
78 * - `area`, `bar`, `bubble`, `candlestick`, `column`, `combo`, `geo`, | 78 * - `area`, `bar`, `bubble`, `candlestick`, `column`, `combo`, `geo`, |
79 * `histogram`, `line`, `pie`, `scatter`, `stepped-area` | 79 * `histogram`, `line`, `pie`, `scatter`, `stepped-area`, `treemap` |
80 * | 80 * |
81 * See <a href="https://google-developers.appspot.com/chart/interactive/do
cs/gallery">Google Visualization API reference (Chart Gallery)</a> for details. | 81 * See <a href="https://google-developers.appspot.com/chart/interactive/do
cs/gallery">Google Visualization API reference (Chart Gallery)</a> for details. |
82 * | 82 * |
83 */ | 83 */ |
84 type: { | 84 type: { |
85 type: String, | 85 type: String, |
86 value: 'column', | 86 value: 'column', |
87 observer: '_typeChanged' | 87 observer: '_typeChanged' |
88 }, | 88 }, |
89 | 89 |
(...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
290 'candlestick': google.visualization.CandlestickChart, | 290 'candlestick': google.visualization.CandlestickChart, |
291 'column': google.visualization.ColumnChart, | 291 'column': google.visualization.ColumnChart, |
292 'combo': google.visualization.ComboChart, | 292 'combo': google.visualization.ComboChart, |
293 'geo': google.visualization.GeoChart, | 293 'geo': google.visualization.GeoChart, |
294 'histogram': google.visualization.Histogram, | 294 'histogram': google.visualization.Histogram, |
295 'line': google.visualization.LineChart, | 295 'line': google.visualization.LineChart, |
296 'pie': google.visualization.PieChart, | 296 'pie': google.visualization.PieChart, |
297 'scatter': google.visualization.ScatterChart, | 297 'scatter': google.visualization.ScatterChart, |
298 'stepped-area': google.visualization.SteppedAreaChart, | 298 'stepped-area': google.visualization.SteppedAreaChart, |
299 'table': google.visualization.Table, | 299 'table': google.visualization.Table, |
300 'gauge': google.visualization.Gauge | 300 'gauge': google.visualization.Gauge, |
| 301 'treemap': google.visualization.TreeMap |
301 }; | 302 }; |
302 }, | 303 }, |
303 | 304 |
304 _loadPackageByChartType: function() { | 305 _loadPackageByChartType: function() { |
305 this._packages = { | 306 this._packages = { |
306 'area': 'corechart', | 307 'area': 'corechart', |
307 'bar': 'corechart', | 308 'bar': 'corechart', |
308 'bubble': 'corechart', | 309 'bubble': 'corechart', |
309 'candlestick': 'corechart', | 310 'candlestick': 'corechart', |
310 'column': 'corechart', | 311 'column': 'corechart', |
311 'combo': 'corechart', | 312 'combo': 'corechart', |
312 'geo': 'corechart', | 313 'geo': 'corechart', |
313 'histogram': 'corechart', | 314 'histogram': 'corechart', |
314 'line': 'corechart', | 315 'line': 'corechart', |
315 'pie': 'corechart', | 316 'pie': 'corechart', |
316 'scatter': 'corechart', | 317 'scatter': 'corechart', |
317 'stepped-area': 'corechart', | 318 'stepped-area': 'corechart', |
318 'table': 'table', | 319 'table': 'table', |
319 'gauge': 'gauge' | 320 'gauge': 'gauge', |
| 321 'treemap': 'treemap' |
320 }; | 322 }; |
321 }, | 323 }, |
322 | 324 |
323 _loadData: function() { | 325 _loadData: function() { |
324 this._canDraw = false; | 326 this._canDraw = false; |
325 if (this._isReady) { | 327 if (this._isReady) { |
326 if (typeof this.data == 'string' || this.data instanceof String) { | 328 if (typeof this.data == 'string' || this.data instanceof String) { |
327 // Load data asynchronously, from external URL. | 329 // Load data asynchronously, from external URL. |
328 this.$.ajax.generateRequest(); | 330 this.$.ajax.generateRequest(); |
329 } else { | 331 } else { |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
377 } else if (data.length > 0) { | 379 } else if (data.length > 0) { |
378 dataTable = google.visualization.arrayToDataTable(data); | 380 dataTable = google.visualization.arrayToDataTable(data); |
379 } | 381 } |
380 } | 382 } |
381 | 383 |
382 return dataTable; | 384 return dataTable; |
383 } | 385 } |
384 }); | 386 }); |
385 })(); | 387 })(); |
386 </script> | 388 </script> |
OLD | NEW |