-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathplugin-demo.html
More file actions
51 lines (42 loc) · 1.24 KB
/
plugin-demo.html
File metadata and controls
51 lines (42 loc) · 1.24 KB
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<script src="./bower_components/chartist/dist/chartist.min.js"></script>
<script src="./src/scripts/chartist-plugin-multithreshold.js"></script>
<link href="./bower_components/chartist/dist/chartist.min.css" rel="stylesheet" type="text/css" />
<link href="./src/styles/chart-style.css" rel="stylesheet" type="text/css" />
<title>Chartist Plugin Demo</title>
</head>
<body>
<div class="ct-chart" id="chart1"></div>
<button onclick="onClick()">Click Me to update chart</button>
<script>
var chart = new Chartist.Line('.ct-chart', {
labels: ['Jan', 'Feb', 'Mar', 'Apr', 'Mai', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'],
series: [
[10, 20, 30, 40, 50, 60, 70, 80, 90, 100, 110, 120]
]
}, {
showArea: false,
axisY: {
onlyInteger: true
},
plugins: [
Chartist.plugins.ctMultiThreshold({
threshold: [20, 40, 60, 80]
})
]
});
</script>
<script>
function onClick() {
chart.update(null, {
multiThresholdOptions: {
threshold: [20, 40, 60]
}
}, true)
}
</script>
</body>
</html>