(label, offset)
| 1 | function makeDs(label, offset) { |
| 2 | return { |
| 3 | label, |
| 4 | data: [ |
| 5 | [0, 12], |
| 6 | [1, 19], |
| 7 | [2, 3], |
| 8 | [2, 5], |
| 9 | [3, 2], |
| 10 | [4, 3], |
| 11 | ].map(([x, y]) => ({x, y: y === null ? null : y + offset})), |
| 12 | showLine: true, |
| 13 | spanGaps: false, |
| 14 | stack: `stack${label}`, |
| 15 | borderColor: label === 'A' ? '#c00' : '#00c' |
| 16 | }; |
| 17 | } |
| 18 | |
| 19 | const dsA = makeDs('A', 0); |
| 20 | const dsB = makeDs('B', 1); |