01.
var
config = {
02.
type:
'line'
,
03.
data: {
04.
datasets: []
05.
}
06.
07.
08.
var
p = 2'
09.
var
t = 5;
10.
for
(
var
i = 1; i<=p; i++){
11.
12.
config.data.datasets.push({
13.
label:
'คนที่ '
+ i,
14.
borderColor: newColor,
15.
borderWidth: newColor,
16.
fill:
false
,
17.
data: []
18.
});
19.
for
(
var
b = 1; b<=t; b++){
20.
21.
22.
var
total = b * 100;
23.
24.
config.data.datasets.data.push({
'x'
: b,
'y'
: total});
25.
26.
}
27.
}