unfallkarte/statistics/highchart.php

195 lines
4.3 KiB
PHP
Raw Normal View History

2023-10-12 08:32:20 +02:00
<script>
Highcharts.chart('c_unfallzahlen', {
chart: {
plotBackgroundColor: null,
plotBorderWidth: null,
plotShadow: false,
type: 'pie'
},
title: {
text: 'Unfallzahlen',
align: 'center'
},
tooltip: {
pointFormat: '{series.name}: <b>{point.percentage:.1f}%</b>'
},
accessibility: {
point: {
valueSuffix: '%'
}
},
plotOptions: {
pie: {
allowPointSelect: true,
cursor: 'pointer',
dataLabels: {
enabled: true,
format: '<b>{point.name}</b>: {point.percentage:.1f} %'
}
}
},
series: [{
name: 'Unfallzahlen',
colorByPoint: true,
data: <?= get_series($resultUnfallzahlen,$arrCategory,"UKATEGORIE") ?>
}]
});
Highcharts.chart('c_unfallarten', {
chart: {
plotBackgroundColor: null,
plotBorderWidth: null,
plotShadow: false,
type: 'pie'
},
title: {
text: 'Unfallarten',
align: 'center'
},
tooltip: {
pointFormat: '{series.name}: <b>{point.percentage:.1f}%</b>'
},
accessibility: {
point: {
valueSuffix: '%'
}
},
plotOptions: {
pie: {
allowPointSelect: true,
cursor: 'pointer',
dataLabels: {
enabled: true,
format: '<b>{point.name}</b>: {point.percentage:.1f} %'
}
}
},
series: [{
name: 'Unfallarten',
colorByPoint: true,
data: <?= get_series($resultUnfallart,$arrUnfallart,"UART") ?>
}]
});
Highcharts.chart('c_unfalltyp', {
chart: {
plotBackgroundColor: null,
plotBorderWidth: null,
plotShadow: false,
type: 'pie'
},
title: {
text: 'Unfalltypen',
align: 'center'
},
tooltip: {
pointFormat: '{series.name}: <b>{point.percentage:.1f}%</b>'
},
accessibility: {
point: {
valueSuffix: '%'
}
},
plotOptions: {
pie: {
allowPointSelect: true,
cursor: 'pointer',
dataLabels: {
enabled: true,
format: '<b>{point.name}</b>: {point.percentage:.1f} %'
}
}
},
series: [{
name: 'Unfallarten',
colorByPoint: true,
data: <?= get_series($resultUnfalltyp,$arrUnfalltyp,"UTYP1") ?>
}]
});
Highcharts.chart('c_unfallbeteiligte', {
chart: {
plotBackgroundColor: null,
plotBorderWidth: null,
plotShadow: false,
type: 'pie'
},
title: {
text: 'Unfallbeteiligte',
align: 'center'
},
tooltip: {
pointFormat: '{series.name}: <b>{point.percentage:.1f}%</b>'
},
accessibility: {
point: {
valueSuffix: '%'
}
},
plotOptions: {
pie: {
allowPointSelect: true,
cursor: 'pointer',
dataLabels: {
enabled: true,
format: '<b>{point.name}</b>: {point.percentage:.1f} %'
}
}
},
series: [{
name: 'Unfallarten',
colorByPoint: true,
data: <?= get_series_beteiligte($resultBeteiligte,$arrBeteiligte) ?>
}]
});
Highcharts.chart('c_unfallverlauf', {
chart: {
type: 'column'
},
title: {
text: 'Verlauf der Fahrradunfälle',
align: 'center'
},
xAxis: {
2024-07-05 10:35:43 +02:00
categories: ['2023','2022','2021','2020','2019']
2023-10-12 08:32:20 +02:00
},
yAxis: {
min: 0,
title: {
text: 'Jahr'
},
stackLabels: {
enabled: true
}
},
legend: {
align: 'left',
2023-10-13 11:01:50 +02:00
x: 420,
2023-10-12 08:32:20 +02:00
verticalAlign: 'bottom',
2023-10-13 11:01:50 +02:00
y: -45,
2023-10-12 08:32:20 +02:00
floating: true,
backgroundColor:
Highcharts.defaultOptions.legend.backgroundColor || 'white',
borderColor: '#CCC',
borderWidth: 1,
shadow: false
},
tooltip: {
headerFormat: '<b>{point.x}</b><br/>',
pointFormat: '{series.name}: {point.y}<br/>Total: {point.stackTotal}'
},
plotOptions: {
column: {
stacking: 'normal',
dataLabels: {
enabled: true
}
}
},
series: <?=get_series_verlauf($resultVerlauf,$arrCategory)?>
});
</script>