diff --git a/manager/module/chart.php b/manager/module/chart.php
index 84968c2..b682c3a 100755
--- a/manager/module/chart.php
+++ b/manager/module/chart.php
@@ -118,11 +118,16 @@
return array(
'ModuleError' => ManagerError::Success,
- 'xlabels' => $labels,
+ 'title' => 'Répartition des appels',
+ 'pointFormat' => '{series.name}: {point.percentage:.1f}%',
'series' => array(array(
- array( 'name' => $labels[0], 'y' => $INCOMING ),
- array( 'name' => $labels[1], 'y' => $OUTGOING ),
- array( 'name' => $labels[2], 'y' => $MISSED ) ))
+ 'colorByPoint' => true,
+ 'data' => array(
+ array( 'name' => 'Entrant', 'y' => $INCOMING ),
+ array( 'name' => 'Sortant', 'y' => $OUTGOING ),
+ array( 'name' => 'Manqué', 'y' => $MISSED ),
+ )
+ ))
);
}
@@ -182,11 +187,14 @@
return array(
'ModuleError' => ManagerError::Success,
- 'xlabels' => array('APPELS', 'SMS'),
+ 'title' => 'Répartition des types de communication',
+ 'pointFormat' => '{series.name}: {point.percentage:.1f}%',
'series' => array(array(
- 'data' => array($PHONE, $SMS),
- 'backgroundColor' => $colors['default'],
- 'hoverBackgroundColor' => $colors['hover']
+ 'colorByPoint' => true,
+ 'data' => array(
+ array( 'name' => 'Appels', 'y' => $PHONE ),
+ array( 'name' => 'SMS', 'y' => $SMS )
+ )
))
);
}
@@ -250,7 +258,6 @@
'pointFormat' => '{series.name}: {point.percentage:.1f}%',
'series' => array(array(
'colorByPoint' => true,
- 'name' => 'Répartition des genres',
'data' => array(
array( 'name' => 'Homme', 'y' => $H ),
array( 'name' => 'Femme', 'y' => $F )
diff --git a/view/js/charts-min.js b/view/js/charts-min.js
index 9c3dffe..ddb0606 100644
--- a/view/js/charts-min.js
+++ b/view/js/charts-min.js
@@ -1,4 +1,4 @@
var subPhone=$('section[data-sublink="phone"]');subPhone.style.display="flex";subPhone.style.flexWrap="wrap";subPhone.style.justifyContent="space-around";Chart.defaults.global.responsive=!1;Chart.defaults.global.title.display=!1;Chart.defaults.global.tooltips.footerFontSize=0;Chart.defaults.global.onClick=function(a,b){console.log(a);null!=b[0]&&console.log(b[0]._datasetIndex,b[0]._index)};subject=273;
-var charts=["sexe","direction","type","ages","relations"],types=["pie","pie","pie","column","bar"],canvas=[],instances=[],c;for(c in charts)canvas[c]=document.createElement("div"),canvas[c].id=charts[c],canvas[c].style.width=canvas[c].style.height="column"==types[c]?"40em":"30em",canvas[c].style.margin="2em",subPhone.appendChild(canvas[c]);
+var charts=["sexe","direction","type","ages","relations"],types=["pie","pie","pie","column","bar"],canvas=[],instances=[],c;for(c in charts)canvas[c]=document.createElement("div"),canvas[c].id=charts[c],canvas[c].style.width=canvas[c].style.height="pie"!=types[c]?"40em":"30em",canvas[c].style.margin="2em",subPhone.appendChild(canvas[c]);
for(c=0;c{point.name}: {point.percentage:.1f} %",style:{color:Highcharts.theme&&Highcharts.theme.contrastTextColor||"black"}}},bar:{allowPointSelect:!0,cursor:"pointer"}}};
null!=a.xlabels&&(d.xAxis={categories:a.xlabels});null!=a.ylabels&&(d.yAxis={categories:a.ylabels});null!=a.title&&(d.title={text:a.title});null!=a.pointFormat&&(d.tooltip={pointFormat:a.pointFormat});instances[e]=new Highcharts.Chart(d)},null,c)};
diff --git a/view/js/charts.js b/view/js/charts.js
index f53cae6..cecb438 100644
--- a/view/js/charts.js
+++ b/view/js/charts.js
@@ -33,7 +33,7 @@ for( var c in charts ){
canvas[c] = document.createElement('div');
canvas[c].id = charts[c];
// canvas[c].width = canvas[c].height = ( types[c] == 'bar' ) ? 500 : 300;
- canvas[c].style.width = canvas[c].style.height = ( types[c] == 'column' ) ? '40em' : '30em';
+ canvas[c].style.width = canvas[c].style.height = ( types[c] != 'pie' ) ? '40em' : '30em';
canvas[c].style.margin = '2em';
subPhone.appendChild( canvas[c] );
}