質問編集履歴
1
情報の修正
test
CHANGED
@@ -1 +1 @@
|
|
1
|
-
|
1
|
+
グラフライブラリとスライダーを連携したいがやり方が分からない。
|
test
CHANGED
@@ -2,132 +2,4 @@
|
|
2
2
|
|
3
3
|
それぞれを表現するコードは分かるのですが、両者を連携するコードが分かりません。
|
4
4
|
|
5
|
-
|
6
|
-
|
7
|
-
```html
|
8
|
-
|
9
|
-
<!DOCTYPE html>
|
10
|
-
|
11
|
-
<html>
|
12
|
-
|
13
|
-
<head>
|
14
|
-
|
15
|
-
<link href="//cdn.bootcss.com/noUiSlider/8.5.1/nouislider.min.css" rel="stylesheet">
|
16
|
-
|
17
|
-
<script src="//cdn.bootcss.com/noUiSlider/8.5.1/nouislider.js"></script>
|
18
|
-
|
19
|
-
<script src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/2.7.1/Chart.min.js"></script>
|
20
|
-
|
21
|
-
</head>
|
22
|
-
|
23
|
-
<body>
|
24
|
-
|
25
|
-
<canvas id="Chart"></canvas>
|
26
|
-
|
27
|
-
<div id="range"></div>
|
28
|
-
|
29
|
-
<script>
|
30
|
-
|
31
|
-
var ctx = document.getElementById("Chart").getContext('2d');
|
32
|
-
|
33
|
-
var ChartDemo = new Chart(ctx, {
|
34
|
-
|
35
|
-
type: 'line',
|
36
|
-
|
37
|
-
data: {
|
38
|
-
|
39
|
-
labels: ["1月", "2月", "3月", "4月", "5月", "6月", "7月"],
|
40
|
-
|
41
|
-
datasets: [
|
42
|
-
|
43
|
-
{
|
44
|
-
|
45
|
-
label: "サンプル",
|
46
|
-
|
47
|
-
borderColor: 'rgb(255, 0, 0)',
|
48
|
-
|
49
|
-
data: [20, 26, 12, 43, 33, 21, 29],
|
50
|
-
|
51
|
-
},
|
52
|
-
|
53
|
-
]
|
54
|
-
|
55
|
-
},
|
56
|
-
|
57
|
-
options: {
|
58
|
-
|
59
|
-
responsive: true,
|
60
|
-
|
61
|
-
}
|
62
|
-
|
63
|
-
});
|
64
|
-
|
65
|
-
</script>
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
<script>
|
70
|
-
|
71
|
-
var range = document.getElementById('range');
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
noUiSlider.create(range, {
|
76
|
-
|
77
|
-
start: [ 1, 7 ],
|
78
|
-
|
79
|
-
step: 1,
|
80
|
-
|
81
|
-
margin: 1,
|
82
|
-
|
83
|
-
connect: true,
|
84
|
-
|
85
|
-
direction: 'ltr',
|
86
|
-
|
87
|
-
orientation: 'horizontal',
|
88
|
-
|
89
|
-
behaviour: 'tap-drag',
|
90
|
-
|
91
|
-
range: {
|
92
|
-
|
93
|
-
'min': 0,
|
94
|
-
|
95
|
-
'max': 7
|
96
|
-
|
97
|
-
},
|
98
|
-
|
99
|
-
pips: {
|
100
|
-
|
101
|
-
mode: 'steps',
|
102
|
-
|
103
|
-
density: 5
|
104
|
-
|
105
|
-
}
|
106
|
-
|
107
|
-
});
|
108
|
-
|
109
|
-
</script>
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
<style>
|
114
|
-
|
115
|
-
#range {
|
116
|
-
|
117
|
-
width: 80%;
|
118
|
-
|
119
|
-
margin: 0 auto 30px;
|
120
|
-
|
121
|
-
}
|
122
|
-
|
123
|
-
</style>
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
</body>
|
128
|
-
|
129
|
-
</html>
|
130
|
-
|
131
|
-
```
|
132
|
-
|
133
5
|
分かる方がいれば教えて頂きたいです。
|