1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63
|
<script type="text/javascript">
$(document).ready(function() {
var options = {
chart: {
renderTo: 'kpi1',
type: 'line',
marginRight: 130,
marginBottom: 25
},
credits:{
enabled:false
},
title: {
text: '',
x: -20 //center
},
subtitle: {
text: '',
x: -20
},
xAxis: {
categories: []
},
yAxis: {
title: {
text: 'Pourcentage'
},
plotLines: [{
value: 0,
width: 1,
color: '#808080'
}]
},
tooltip: {
formatter: function() {
return '<b>'+ this.series.name +'</b><br/>'+
this.x +': '+ this.y;
}
},
legend: {
layout: 'vertical',
align: 'right',
verticalAlign: 'top',
x: -10,
y: 100,
borderWidth: 0
},
series: []
}
$.getJSON("datakpi1.php?cellname=<?php echo $namecell; ?>", function(json) {
console.log(json);
options.xAxis.categories = json[0]['data'];
options.series[0] = json[1];
//options.series[1] = json[2];
chart = new Highcharts.Chart(options);
});
});
</script> |
Partager