-
Notifications
You must be signed in to change notification settings - Fork 0
/
testCaseRate.js
65 lines (60 loc) · 1.08 KB
/
testCaseRate.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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
import data from './data.json'
const finalData = {
labels: [],
percentages: []
}
data.data.forEach(d => {
if (d.test < 1) {
return
}
finalData.labels.push(d.date)
finalData.percentages.push(
((d.case / d.test) * 100).toFixed(2)
)
})
var config = {
type: 'line',
data: {
labels: finalData.labels,
datasets: [
{
label: 'Oran',
data: finalData.percentages,
fill: false,
borderColor: 'rgba(100, 180, 255, 1)'
}
]
},
options: {
responsive: true,
title: {
display: true,
text: 'Türkiye - Covid 19 - Her 100 testte çıkan pozitif vaka sayısı'
},
tooltips: {
mode: 'index',
intersect: false
},
hover: {
mode: 'nearest',
intersect: true
},
scales: {
xAxes: [{
display: true,
scaleLabel: {
display: true,
labelString: 'Gün'
}
}],
yAxes: [{
display: true,
scaleLabel: {
display: true,
labelString: 'Oran'
}
}]
}
}
}
export default config