-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhc-iron-pie.html
70 lines (66 loc) · 1.83 KB
/
hc-iron-pie.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
<link rel="import" href="hc-chart-behaviours.html"/>
<dom-module id="hc-iron-pie">
<style>
.chart-container {
width: 100%; margin: 0 auto; height: 100%;
}
</style>
<template>
<!-- Iron Ajax -->
<iron-ajax id="ajax" url="{{url}}" last-response="{{data}}" debounce-duration="300"></iron-ajax>
<div id="piecontainer" class="chart-container"></div>
</template>
<script>
Polymer({
is: "hc-iron-pie",
behaviors: [HCProperties],
_chartData: function (data) {
new Highcharts.Chart({
colors: this.createSeriesColorsArray(this.dataVisColors, this.seriesColorOrder),
chart: {
renderTo: this.$.piecontainer,
height: this.chartHeight,
width: this.chartWidth,
plotBackgroundColor: null,
plotBorderWidth: null,
plotShadow: false,
type: 'pie'
},
title: {
text: ''
},
exporting: {
enabled: false
},
legend: {
enabled: this.legendEnabled
},
credits: {
enabled: false
},
tooltip: {
pointFormat: '{series.name}: <b>{point.percentage:.1f}%</b>'
},
plotOptions: {
pie: {
allowPointSelect: true,
cursor: 'pointer',
dataLabels: {
enabled: false,
format: '<b>{point.name}</b>: {point.percentage:.1f} %',
style: {
color: (Highcharts.theme && Highcharts.theme.contrastTextColor) || 'black'
}
}
}
},
series: [{
name: "Brands",
data: data.series,
animation: false
}]
});
}
});
</script>
</dom-module>