Apply fix to dashboard block graphs - refs CT#7383

1.9.x
Daniel Barreto 11 years ago
parent 468ded54a5
commit 0a5e7b6cf9
  1. 20
      plugin/dashboard/block_evaluation_graph/block_evaluation_graph.class.php
  2. 4
      plugin/dashboard/block_teacher_graph/block_teacher_graph.class.php

@ -166,14 +166,16 @@ class BlockEvaluationGraph extends Block
$img_file = $cache->GetHash($graph_id, $data);
} else {
// Initialise the graph
$angle = -30;
$test = new pChart($this->bg_width,$this->bg_height);
$test->setFontProperties(api_get_path(LIBRARY_PATH).'pchart/fonts/tahoma.ttf',8);
$test->setGraphArea(50,30,$this->bg_width-75,$this->bg_height-75);
$test->drawFilledRoundedRectangle(7,7,$this->bg_width-20,$this->bg_height-20,5,240,240,240);
$test->drawRoundedRectangle(5,5,$this->bg_width-18,$this->bg_height-18,5,230,230,230);
$test = $test->fixHeightByRotation($data_set->GetData(),$data_set->GetDataDescription(), $angle);
$test->setGraphArea(50,30,$this->bg_width-75,$test->YSize - 75);
$test->drawFilledRoundedRectangle(7,7,$this->bg_width-20,$test->YSize - 20,5,240,240,240);
$test->drawRoundedRectangle(5,5,$this->bg_width-18,$test->YSize - 18,5,230,230,230);
$test->drawGraphArea(255,255,255,TRUE);
$test->setFixedScale(0,100,5);
$test->drawScale($data_set->GetData(),$data_set->GetDataDescription(),SCALE_ADDALL,150,150,150,TRUE,0,2,TRUE);
$test->drawScale($data_set->GetData(),$data_set->GetDataDescription(),SCALE_ADDALL,150,150,150,TRUE,$angle,2,TRUE);
$test->setColorPalette(0,105,221,34);
$test->setColorPalette(1,255,135,30);
$test->setColorPalette(2,255,0,0);
@ -258,14 +260,16 @@ class BlockEvaluationGraph extends Block
$img_file = $cache->GetHash($graph_id, $data);
} else {
// Initialise the graph
$angle = -30;
$test = new pChart($this->bg_width,$this->bg_height);
$test->setFontProperties(api_get_path(LIBRARY_PATH).'pchart/fonts/tahoma.ttf',8);
$test->setGraphArea(50,30,$this->bg_width-75,$this->bg_height-75);
$test->drawFilledRoundedRectangle(7,7,$this->bg_width-20,$this->bg_height-20,5,240,240,240);
$test->drawRoundedRectangle(5,5,$this->bg_width-18,$this->bg_height-18,5,230,230,230);
$test->fixHeightByRotation($data_set->GetData(),$data_set->GetDataDescription(), $angle);
$test->setGraphArea(50,30,$this->bg_width-75,$test->YSize-75);
$test->drawFilledRoundedRectangle(7,7,$this->bg_width-20,$test->YSize-20,5,240,240,240);
$test->drawRoundedRectangle(5,5,$this->bg_width-18,$test->YSize-18,5,230,230,230);
$test->drawGraphArea(255,255,255,TRUE);
$test->setFixedScale(0,100,5);
$test->drawScale($data_set->GetData(),$data_set->GetDataDescription(),SCALE_ADDALL,150,150,150,TRUE,0,2,TRUE);
$test->drawScale($data_set->GetData(),$data_set->GetDataDescription(),SCALE_ADDALL,150,150,150,TRUE,$angle,2,TRUE);
$test->setColorPalette(0,105,221,34);
$test->setColorPalette(1,255,135,30);
$test->setColorPalette(2,255,0,0);

@ -144,13 +144,15 @@ class BlockTeacherGraph extends Block
// Initializing the graph
$bg_width = 440;
$bg_height = 350;
$angle = -30;
$test = new pChart($bg_width+10,$bg_height+20);
$test->setFontProperties(api_get_path(LIBRARY_PATH).'pchart/fonts/tahoma.ttf',8);
$test = $test->fixHeightByRotation($data_set->GetData(),$data_set->GetDataDescription(), $angle);
$test->setGraphArea(65,30,$bg_width-70,$bg_height-50);
$test->drawFilledRoundedRectangle(7,7,$bg_width,$bg_height,5,240,240,240);
$test->drawRoundedRectangle(5,5,$bg_width+2,$bg_height+2,5,230,230,230);
$test->drawGraphArea(255,255,255,TRUE);
$test->drawScale($data_set->GetData(),$data_set->GetDataDescription(),SCALE_NORMAL,150,150,150,TRUE,0,2,TRUE);
$test->drawScale($data_set->GetData(),$data_set->GetDataDescription(),SCALE_NORMAL,150,150,150,TRUE,$angle,2,TRUE);
$test->drawGrid(4,TRUE,230,230,230,50);
// Drawing lines

Loading…
Cancel
Save