質問編集履歴

1

CODE全部載せました

2018/08/05 00:30

投稿

cat_tom
cat_tom

スコア12

test CHANGED
File without changes
test CHANGED
@@ -6,78 +6,116 @@
6
6
 
7
7
  ```ここに言語を入力
8
8
 
9
- var ctx = document.getElementById('chart').getContext('2d');
9
+ <html>
10
10
 
11
- var myChart = new Chart(ctx, {
11
+ <head>
12
12
 
13
- type: 'radar',
13
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
14
14
 
15
- data: {
15
+ <title>データテスト</title>
16
16
 
17
- labels: ['総合','DP1', 'DP2', 'DP3', 'DP4', 'DP5'],
17
+ <script src="Chart.bundle.min.js"></script>
18
18
 
19
- datasets: [{
19
+ <script src="utils.js"></script>
20
20
 
21
- label: 'グループ別到達度',
22
-
23
- data: [dpx, dp1x, dp2x, dp3x, dp4x, dp5x],
24
-
25
- backgroundColor: "rgba(255,0,0,0.2)", // 線の下の塗りつぶしの色
26
-
27
- borderColor: "red", // 線の色
28
-
29
- //hoverが機能しない(2行)
21
+ </head>
30
-
31
- HoverBackgroundColor: "rgba(255,0,0,0.2)",
32
-
33
- HoverBorderColor: "red",
34
22
 
35
23
 
36
24
 
37
- borderWidth: 2, // 線の幅
25
+ <body>
38
26
 
39
- pointStyle: "circle", // 点の形状
27
+ <canvas id="chart" width=256 height=256></canvas>
40
28
 
41
- pointRadius: 6, // 点形状の半径
42
29
 
43
- pointBorderColor: "red", // 点の境界線の色
44
30
 
45
- pointBorderWidth: 2, // 点の境界線の幅
31
+ <script type="text/javascript">
46
32
 
47
- pointBackgroundColor: "yellow", // 点の塗りつぶし色
48
33
 
49
- pointLabelFontSize: 200
50
34
 
51
- }]
35
+ var ctx = document.getElementById('chart').getContext('2d');
52
36
 
53
- },
37
+ var myChart = new Chart(ctx, {
54
38
 
55
- options: {
39
+ type: 'radar',
56
40
 
57
- scale: {
41
+ data: {
58
42
 
59
- legend: {
43
+ labels: ['総合','DP1', 'DP2', 'DP3', 'DP4', 'DP5'],
60
44
 
61
- position: 'left',
45
+ datasets: [{
62
46
 
63
- },
47
+ label: 'グループ別達成度',
64
48
 
65
- ticks: {
49
+ //backgroundColor: "rgba(153,255,255,0.4)"
66
50
 
67
- stepSize: 10, // 目盛の間隔
51
+ data: [55, 85, 70, 90, 65,80],
68
52
 
69
- max: 100, //最大値
53
+ backgroundColor: "rgba(255,0,0,0.2)", // 線の下の塗りつぶしの色
70
54
 
55
+ borderColor: "red", // 線の色
56
+
57
+ //この2行が機能していなような!?
58
+
59
+ HoverBackgroundColor: "rgba(255,0,0,0.2)",
60
+
61
+ HoverBorderColor: "red",
62
+
63
+
64
+
65
+ borderWidth: 2, // 線の幅
66
+
67
+ pointStyle: "circle", // 点の形状
68
+
69
+ pointRadius: 6, // 点形状の半径
70
+
71
+ pointBorderColor: "red", // 点の境界線の色
72
+
73
+ pointBorderWidth: 2, // 点の境界線の幅
74
+
75
+ pointBackgroundColor: "yellow", // 点の塗りつぶし色
76
+
77
+ pointLabelFontSize: 200
78
+
79
+ }]
80
+
81
+ },
82
+
83
+ options: {
84
+
85
+ scale: {
86
+
87
+ legend: {
88
+
89
+ position: 'left',
90
+
91
+ },
92
+
93
+ ticks: {
94
+
95
+ stepSize: 10, // 目盛の間隔
96
+
97
+ max: 100, //最大値
98
+
71
- beginAtZero: true
99
+ beginAtZero: true
100
+
101
+ }
72
102
 
73
103
  }
74
104
 
75
- }
105
+ }
76
-
77
- }
78
-
79
- });
80
106
 
81
107
 
82
108
 
109
+ });
110
+
111
+
112
+
113
+ </script>
114
+
115
+
116
+
117
+ </body>
118
+
119
+ </html>
120
+
83
121
  ```