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
|
$('#button1').click(function () {
if (document.myform.button1.value == "Traffic distribution/Destination AS") {
// renommner le bouton
document.myform.button1.value="Traffic distribution/Source AS";
// 4eme graphe
var series4 = $('#jqChart4').jqChart('option', 'series');
var newaxes4 = {
type: 'category',
location: 'bottom',
categories: [<?php echo $categories_d ?>],
zoomEnabled: true,
labels: {
font: '13px sans-serif',
fillStyle: '#eeeeee',
angle: -45
},
resolveOverlappingMode: 'hide',
};
var axes4 = $('#jqChart4').jqChart('option', 'axes');
var newSeries4 = {
title:'Today statistics',
type: 'column',
fillStyle: 'gray',
data: [<?php echo $today_data; ?>],
};
series4.splice(series4.length - 1, 1);
series4.push(newSeries4);
axes4.splice(series4.length - 1, 1);
axes4.push(newaxes4);
$('#jqChart4').jqChart('update');
}
else {
document.myform.button1.value = "Traffic distribution/Destination AS";
// 4eme graphe
var series4 = $('#jqChart4').jqChart('option', 'series');
var axes4 = $('#jqChart4').jqChart('option', 'axes');
var newSeries4 = {
title:'This week statistics',
type: 'column',
fillStyle: '#9932CC',
data: [<?php echo $week_data; ?>],
};
var newaxes4 = {
type: 'category',
location: 'bottom',
categories: [<?php echo $categories_w ?>],
zoomEnabled: true,
labels: {
font: '13px sans-serif',
fillStyle: '#eeeeee',
angle: -45
},
resolveOverlappingMode: 'hide',
};
series4.splice(series4.length - 1, 1);
series4.push(newSeries4);
axes4.splice(series4.length - 1, 1);
axes4.push(newaxes4);
$('#jqChart4').jqChart('update');
}
}); |
Partager