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.
90 righe
2.5 KiB
90 righe
2.5 KiB
<? |
|
if (!empty($titolo) && !empty($serie) && !empty($idGraph)) { |
|
?> |
|
<div id="graph<?= $idGraph ?>"></div> |
|
<script> |
|
var thisChart<?= $idGraph ?> = Highcharts.chart('graph<?= $idGraph ?>', { |
|
chart: { |
|
polar: true, |
|
type: 'line' |
|
}, |
|
|
|
accessibility: { |
|
description: "<?= $titolo ?>" |
|
}, |
|
|
|
title: { |
|
text: "<?= $titolo ?>" |
|
}, |
|
|
|
pane: { |
|
size: '100%' |
|
}, |
|
|
|
xAxis: { |
|
categories: [ |
|
<? |
|
$labels = array_keys($serie[0]); |
|
foreach($labels AS $label) { |
|
echo "\"{$label}\","; |
|
} |
|
?> |
|
], |
|
tickmarkPlacement: 'on', |
|
lineWidth: 0 |
|
}, |
|
|
|
yAxis: { |
|
gridLineInterpolation: 'polygon', |
|
lineWidth: 0, |
|
min: 0, |
|
}, |
|
|
|
tooltip: { |
|
shared: true, |
|
pointFormat: '<span style="color:{series.color}">{series.name}: <b>{point.y:,.0f}</b><br/>' |
|
}, |
|
|
|
legend: { |
|
align: 'center', |
|
verticalAlign: 'bottom', |
|
layout: 'vertical' |
|
}, |
|
|
|
series: [ |
|
<? foreach($serie AS $group => $data) { ?> |
|
{ |
|
name: "<?= $data[$label]["info"]["label"] ?>", |
|
data: [ |
|
<? foreach($data AS $valore) { |
|
echo $valore["data"] .","; |
|
} ?> |
|
], |
|
pointPlacement: 'on' |
|
}, |
|
<? } ?> |
|
], |
|
responsive: { |
|
rules: [{ |
|
condition: { |
|
maxWidth: 500 |
|
}, |
|
chartOptions: { |
|
legend: { |
|
align: 'center', |
|
verticalAlign: 'bottom', |
|
layout: 'horizontal' |
|
}, |
|
pane: { |
|
size: '70%' |
|
} |
|
} |
|
}] |
|
} |
|
|
|
}); |
|
charts.push(thisChart<?= $idGraph ?>); |
|
</script> |
|
<? |
|
} |
|
?>
|