Commit 8203c255 authored by Michał Woźniak's avatar Michał Woźniak
Browse files

fixed y-axis for per-million chart value mode

parent 15b633c4
Pipeline #137 passed with stage
in 0 seconds
......@@ -1125,13 +1125,24 @@ let updateChartSettings = () => {
// move the y-axis zero point depending on whether we're showing cumulative or new cases
if (document.querySelector('input[type=radio][name=chart-cases]:checked').value === 'cumulative') {
theChart.options.scales.yAxes[0].ticks.min = chart_start
if (document.querySelector('input[type=radio][name=chart-values]:checked').value === 'absolute') {
theChart.options.scales.yAxes[0].ticks.min = chart_start
} else {
theChart.options.scales.yAxes[0].ticks.min = 1
}
theChart.options.scales.yAxes[0].scaleLabel.labelString = "Confirmed cases, cumulative"
} else {
theChart.options.scales.yAxes[0].ticks.min = 1
theChart.options.scales.yAxes[0].scaleLabel.labelString = "Confirmed cases, new"
}
// amend the y-axis label
if (document.querySelector('input[type=radio][name=chart-values]:checked').value === 'absolute') {
theChart.options.scales.yAxes[0].scaleLabel.labelString += ', absolute'
} else {
theChart.options.scales.yAxes[0].scaleLabel.labelString += ', per 1 million people'
}
// update x axis label
if (chart_start == 1) {
theChart.options.scales.xAxes[0].scaleLabel.labelString = "Days since 1st confirmed case"
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment