displaying MedianOfFreeBedsByKreisChartView horizontal instead of vertical

This commit is contained in:
frankknoll
2022-03-30 19:40:16 +02:00
parent 40268894c7
commit 80f430ef71
2 changed files with 6 additions and 4 deletions

View File

@@ -33,7 +33,7 @@ class MedianOfFreeBedsByKreisChartView {
label: label, label: label,
data: data, data: data,
parsing: { parsing: {
yAxisKey: 'median_free_beds_in_percent' xAxisKey: 'median_free_beds_in_percent'
}, },
backgroundColor: 'rgba(0, 255, 0, 1)' backgroundColor: 'rgba(0, 255, 0, 1)'
} }
@@ -43,6 +43,7 @@ class MedianOfFreeBedsByKreisChartView {
#getOptions(label) { #getOptions(label) {
return { return {
indexAxis: 'y',
plugins: { plugins: {
title: { title: {
display: true, display: true,
@@ -56,16 +57,16 @@ class MedianOfFreeBedsByKreisChartView {
}, },
responsive: true, responsive: true,
scales: { scales: {
x: { y: {
title: { title: {
display: true, display: true,
text: 'Landkreis' text: 'Landkreis'
} }
}, },
y: UIUtils.getPercentageScale(label) x: UIUtils.getPercentageScale(label)
}, },
parsing: { parsing: {
xAxisKey: 'Kreis' yAxisKey: 'Kreis'
} }
}; };
} }

View File

@@ -72,6 +72,7 @@ function createSlider(sliderElement, range, onUpdate) {
connect: true, connect: true,
range: range, range: range,
step: 1, step: 1,
orientation: 'horizontal'
}); });
sliderElement.noUiSlider.on('update', onUpdate); sliderElement.noUiSlider.on('update', onUpdate);
} }