gestione gare pubbliche
Non puoi selezionare più di 25 argomenti Gli argomenti devono iniziare con una lettera o un numero, possono includere trattini ('-') e possono essere lunghi fino a 35 caratteri.
 
 
 
 
 

111 righe
3.2 KiB

<?
if (!empty($titolo) && !empty($serie) && !empty($idGraph)) {
?>
<div id="graph<?= $idGraph ?>"></div>
<script>
var thisChart<?= $idGraph ?> = Highcharts.chart('graph<?= $idGraph ?>', {
chart: {
type: 'pie',
spacing:0,
margin:50,
backgroundColor: 'rgba(255, 255, 255, 1.0)',
showAxes: true,
zoomType: 'x',
height: <?= $chartHeight ?>
},
exporting: {
enabled: true
},
xAxis: {
visible: false,
},
yAxis: {
visible: false,
},
plotOptions: {
series: {
dataLabels: {
enabled: true
}
},
pie: {
dataLabels: {
enabled: true,
distance: -50,
style: {
fontWeight: 'bold',
color: 'white'
}
},
startAngle: -90,
endAngle: 90,
center: ['50%', '75%'],
size: '110%'
},
},
title: { text: "<?= str_replace('"','',$titolo) ?>"},
series: [{
name : "<?= str_replace('"','',$titolo) ?>",
dataLabels: {
enabled: true
},
innerSize: '75%',
data: [
<?
$drilldowns = [];
foreach($serie AS $group) {
foreach($group AS $label => $data) {
if (isset($data["info"])) {
?>
{
y: <?= $data["data"] ?>,
<? if (!empty($data["info"]["color"])) { ?>color: "<?= $data["info"]["color"] ?>",<? } ?>
name: "<?= str_replace('"','',$label); ?>",
},
<?
} else {
$value = 0;
foreach($data AS $labelSub => $subGroup) {
$value += $subGroup["data"];
$drilldowns[$label][$labelSub] = $subGroup;
}
?>
{
y: <?= $value ?>,
name: "<?= str_replace('"','',$label); ?>",
drilldown: '<?= md5($label) ?>'
},
<?
}
}
}
?>
]
}],
<? if (!empty($drilldowns)) { ?>
drilldown: {
series: [
<? foreach($drilldowns AS $idDrill => $info) { ?>
{
name: "<?= str_replace('"','',$idDrill); ?>",
id: "<?= md5($idDrill) ?>",
innerSize: '75%',
data: [
<? foreach($info AS $label => $element) { ?>
[
"<?= str_replace('"','',$label) ?>",
<?= $element["data"] ?>
],
<? } ?>
]
},
<? } ?>
]
}
<? } ?>
})
charts.push(thisChart<?= $idGraph ?>);
</script>
<?
}
?>