-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmultiple_line_chart.js
51 lines (46 loc) · 1.44 KB
/
multiple_line_chart.js
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
import MultipleDatasetChart from './multiple_dataset_chart.js'
export default class MultipleLineChart extends MultipleDatasetChart {
constructor(parameters = { canvas: null, statistics_container: null }) {
super(parameters)
}
_construct_chart_dataset(dataset, index, nr_of_datasets) {
const dataset_object = super._construct_chart_dataset(dataset, index, nr_of_datasets)
dataset_object.type = 'line'
dataset_object.borderJoinStyle = 'round'
dataset_object.pointRadius = 0
dataset_object.borderColor =
`rgba(0,` +
`${(255 / nr_of_datasets) * (nr_of_datasets - index)},` +
`${(255 / nr_of_datasets) * index},1`
dataset_object.borderWidth = 2
dataset_object.fill = false
dataset_object.datalabels = {
labels: {
title: null
}
}
return dataset_object
}
_construct_chart_options() {
return {
plugins: {
title: {
text: this.title,
display: true
}
},
responsive: true,
maintainAspectRatio: false,
scales: {
y: {
stacked: true
},
x: {
stacked: true,
offset: true,
display: true
}
}
}
}
}