Skip to content

Commit e36d15b

Browse files
committed
Improve graphic's esthetics
1 parent 2197716 commit e36d15b

File tree

1 file changed

+10
-7
lines changed

1 file changed

+10
-7
lines changed

plugin/dashboard/block_teacher_graph/block_teacher_graph.class.php

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -149,22 +149,25 @@ public function get_teachers_information_graph() {
149149
} else {
150150

151151
// Initializing the graph
152-
$test = new pChart(400,330);
152+
$bg_width = 440;
153+
$bg_height = 350;
154+
$test = new pChart($bg_width+10,$bg_height+20);
153155
$test->setFontProperties(api_get_path(LIBRARY_PATH).'pchart/fonts/tahoma.ttf',8);
154-
$test->setGraphArea(65,30,350,250);
155-
$test->drawFilledRoundedRectangle(7,7,393,303,5,240,240,240);
156-
$test->drawRoundedRectangle(5,5,395,305,5,230,230,230);
156+
$test->setGraphArea(65,30,$bg_width-70,$bg_height-50);
157+
$test->drawFilledRoundedRectangle(7,7,$bg_width,$bg_height,5,240,240,240);
158+
$test->drawRoundedRectangle(5,5,$bg_width+2,$bg_height+2,5,230,230,230);
157159
$test->drawGraphArea(255,255,255,TRUE);
158160
$test->drawScale($data_set->GetData(),$data_set->GetDataDescription(),SCALE_NORMAL,150,150,150,TRUE,0,2,TRUE);
159161
$test->drawGrid(4,TRUE,230,230,230,50);
160162

161163
// Drawing lines
162-
$test->drawLineGraph($data_set->GetData(),$data_set->GetDataDescription());
163-
$test->drawPlotGraph($data_set->GetData(),$data_set->GetDataDescription(),3,2,255,255,255);
164+
//$test->drawLineGraph($data_set->GetData(),$data_set->GetDataDescription());
165+
$test->drawFilledCubicCurve($data_set->GetData(),$data_set->GetDataDescription(),.1,30);
166+
//$test->drawPlotGraph($data_set->GetData(),$data_set->GetDataDescription(),3,2,255,255,255);
164167

165168
// Drawing Legend
166169
$test->setFontProperties(api_get_path(LIBRARY_PATH).'pchart/fonts/tahoma.ttf',8);
167-
$test->drawLegend(320,20,$data_set->GetDataDescription(),204,204,255);
170+
$test->drawLegend($bg_width-80,20,$data_set->GetDataDescription(),204,204,255);
168171

169172
$test->writeValues($data_set->GetData(),$data_set->GetDataDescription(),array("Days"));
170173

0 commit comments

Comments
 (0)