Issue #0001889: [IndiScore] affichage de graphique
This commit is contained in:
parent
bb26fb81fe
commit
3cd50f8f0e
@ -75,7 +75,6 @@ class EvaluationController extends Zend_Controller_Action
|
||||
if ( $histoScores->nbReponses>1 ) {
|
||||
|
||||
$data = array();
|
||||
$data['unite'] = '';
|
||||
foreach ($histoScores->result->item as $item) {
|
||||
$d = array(
|
||||
'date' => $item->date,
|
||||
@ -95,33 +94,40 @@ class EvaluationController extends Zend_Controller_Action
|
||||
if( $cache->exist($path.$file) ){
|
||||
$return = $file;
|
||||
} else {
|
||||
if( count($data)<=1 ){
|
||||
if( count($data)<1 ){
|
||||
$return = null;
|
||||
} else {
|
||||
$labelsX = array();
|
||||
$labelsY = array();
|
||||
$dataX1 = array();
|
||||
$dataX2 = array();
|
||||
$dataX = array();
|
||||
foreach($data['data'] as $value){
|
||||
$dataX1[] = $value['value'];
|
||||
$labelsX[] = $value['date'];
|
||||
$dataX[] = $value['value'];
|
||||
$date = new Zend_Date($value['date'], 'yyyy-MM-dd');
|
||||
$labelsX[] = $date->toString('dd/MM/yyyy');
|
||||
}
|
||||
$i=-100; while($i>100){
|
||||
$labelsY[] = $i;
|
||||
}
|
||||
$c = new XYChart(500, 250);
|
||||
$c->setPlotArea(70, 10, 450, 200);
|
||||
$c->yAxis->setTitle($data['unite']);
|
||||
|
||||
$c = new XYChart(600, 300);
|
||||
$c->setPlotArea(40, 10, 540, 200, 0xE9EDFF, 0xFFFFFF, 0xC0C0C0, 0xC0C0C0, 0xC0C0C0);
|
||||
$c->xAxis->setTitle("Date");
|
||||
$c->xAxis->setColors(0x777777, 0x444444, 0x777777);
|
||||
$c->xAxis->setWidth(2);
|
||||
$c->yAxis->setTitle("Score");
|
||||
$c->yAxis->setWidth(2);
|
||||
$legendObj = $c->addLegend(50, 10, false, "times.ttf", 9);
|
||||
$legendObj->setBackground(Transparent);
|
||||
$c->addLineLayer($dataX1, 0x0000ff, "Evolution");
|
||||
$c->yAxis->setLabels($labelsY);
|
||||
$c->yAxis->setLabelStep(10);
|
||||
$c->xAxis->setLabelStyle("arial.ttf", 8, 0x444444, 90);
|
||||
$c->xAxis->setLabels($labelsX);
|
||||
$c->yAxis->setTitle("Score");
|
||||
$c->yAxis->setColors(0x777777, 0x444444, 0x777777);
|
||||
$c->yAxis->setWidth(2);
|
||||
$c->yAxis->setLabels($labelsY);
|
||||
|
||||
$textBoxObj = $c->addText(550, 15, 'IndiScore', "arialbi.ttf", 11, 0xAAAAAA);
|
||||
$textBoxObj->setAlignment(TopRight);
|
||||
|
||||
$layer = $c->addSplineLayer();
|
||||
$layer->setDataLabelFormat("{value}");
|
||||
$layer->setLineWidth(1);
|
||||
|
||||
$dataSetObj = $layer->addDataSet($dataX, 0x0000FF, "Target Group");
|
||||
$dataSetObj->setDataSymbol(CircleSymbol, 3, 0x5555FF);
|
||||
|
||||
if( $c->makeChart($path.$file ) === true){
|
||||
$return = $file;
|
||||
} else {
|
||||
|
Loading…
Reference in New Issue
Block a user