-
Notifications
You must be signed in to change notification settings - Fork 0
/
1-1.1graph.html
113 lines (110 loc) · 2.84 KB
/
1-1.1graph.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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
<!DOCTYPE HTML>
<html>
<head>
<script>
window.onload = function () {
var chart = new CanvasJS.Chart("chartContainer", {
animationEnabled: true,
title:{
text: "機車與電動機車的補助金額差異"
},
axisY: {
title: "NT$",
titleFontColor: "#4F81BC",
lineColor: "#4F81BC",
labelFontColor: "#4F81BC",
tickColor: "#4F81BC"
},
axisY2: {
title: "Millions of Barrels/day",
titleFontColor: "#C0504E",
lineColor: "#C0504E",
labelFontColor: "#C0504E",
tickColor: "#C0504E"
},
toolTip: {
shared: true
},
legend: {
cursor:"pointer",
itemclick: toggleDataSeries
},
data: [{
type: "column",
name: "原價",
legendText: "原價",
showInLegend: true,
dataPoints:[
{ y: 84200, label: "Racing S 125" },
{ y: 84000, label: "Jet S 125" },
{ y: 83700, label: "勁戰 125" },
{ y: 85000, label: "Alpha Max 125" },
{ y: 59000, label: "GP 125" },
{ y: 59000, label: "GT Super 2" },
{ y: 65500, label: "新迪爵 125" },
{ y: 69700, label: "勁豪 125"},
{ y: 73800, label: "Gogoro 2"},
{ y: 79800, label: "Gogoro 2 Plus"},
{ y: 129000, label: "Gogoro S1"},
{ y: 95800, label: "Gogoro S2"}
]
},
{
type: "column",
name: "平均補助",
legendText: "平均補助",
showInLegend: true,
dataPoints:[
{ y: 2050, label: "Racing S 125" },
{ y: 2050, label: "Jet S 125" },
{ y: 2050, label: "勁戰 125" },
{ y: 2050, label: "Alpha Max 125" },
{ y: 2050, label: "GP 125" },
{ y: 2050, label: "GT Super 2" },
{ y: 2050, label: "新迪爵 125" },
{ y: 2050, label: "勁豪 125"},
{ y: 24500, label: "Gogoro 2"},
{ y: 24500, label: "Gogoro 2 Plus"},
{ y: 24500, label: "Gogoro S1"},
{ y: 24500, label: "Gogoro S2"}
]
},
{
type: "column",
name: "實際購買價格",
legendText: "實際購買價格",
showInLegend: true,
dataPoints:[
{ y: 82150, label: "Racing S 125" },
{ y: 81950, label: "Jet S 125" },
{ y: 81650, label: "勁戰 125" },
{ y: 82950, label: "Alpha Max 125" },
{ y: 56950, label: "GP 125" },
{ y: 56950, label: "GT Super 2" },
{ y: 63450, label: "新迪爵 125" },
{ y: 67650, label: "勁豪 125"},
{ y: 49300, label: "Gogoro 2"},
{ y: 55300, label: "Gogoro 2 Plus"},
{ y: 104500, label: "Gogoro S1"},
{ y: 71300, label: "Gogoro S2"}
]
}]
});
chart.render();
function toggleDataSeries(e) {
if (typeof(e.dataSeries.visible) === "undefined" || e.dataSeries.visible) {
e.dataSeries.visible = false;
}
else {
e.dataSeries.visible = true;
}
chart.render();
}
}
</script>
</head>
<body>
<div id="chartContainer" style="height: 500px; width: 100%;"></div>
<script src="https://canvasjs.com/assets/script/canvasjs.min.js"></script>
</body>
</html>