Skip to content

Commit 575648a

Browse files
committed
Merge pull request #33 from philipwalton/chart-sizing
Use styles for chart sizing
2 parents c0b1d8d + e429395 commit 575648a

File tree

1 file changed

+18
-26
lines changed

1 file changed

+18
-26
lines changed

google-analytics-chart.html

+18-26
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,24 @@
2424
-->
2525

2626
<dom-module is="google-analytics-chart">
27+
<style>
28+
:host {
29+
display: -webkit-flex;
30+
display: -ms-flexbox;
31+
display: flex;
32+
-webkit-flex-direction: column;
33+
-ms-flex-direction: column;
34+
flex-direction: column;
35+
width: 400px;
36+
height: 300px;
37+
}
38+
google-chart {
39+
-webkit-flex: 1 0 0%;
40+
-ms-flex: 1 0 0%;
41+
flex: 1 0 0%;
42+
width: auto;
43+
}
44+
</style>
2745
<template>
2846
<google-analytics-loader all-ready="{{setupReady}}"></google-analytics-loader>
2947
<google-analytics-query id="query"
@@ -47,8 +65,6 @@
4765
<content select="header,h1,h2,h3,h4,h5,h6"></content>
4866
<google-chart id="chart"
4967
type="{{type}}"
50-
width="{{width}}"
51-
height="{{height}}"
5268
data="{{data.dataTable}}">
5369
</google-chart>
5470
<content select="footer"></content>
@@ -82,30 +98,6 @@
8298
value: 'area'
8399
},
84100

85-
/**
86-
* Sets the width of the chart on the page.
87-
*
88-
* @attribute width
89-
* @default 480
90-
* @type number of string
91-
*/
92-
width: {
93-
type: Number,
94-
value: 480
95-
},
96-
97-
/**
98-
* Sets the height of the chart on the page.
99-
*
100-
* @attribute height
101-
* @default 320
102-
* @type number or string
103-
*/
104-
height: {
105-
type: Number,
106-
value: 320,
107-
},
108-
109101
/**
110102
* Sets the options for the chart.
111103
*

0 commit comments

Comments
 (0)