[svn r18972] Showing contrast colors in the Gradebook graph see FS#3805

skala
Julio Montoya 17 years ago
parent f1ab86913f
commit db2dd32161
  1. 15
      main/gradebook/lib/fe/flatviewtable.class.php
  2. 7
      main/inc/lib/pchart/palette/reduced.txt
  3. 5
      main/inc/lib/pchart/palette/soft_tones.txt

@ -106,9 +106,12 @@ class FlatViewTable extends SortableTable
// the graph id
$gradebook_id = Security::remove_XSS($_GET['selectcat']);
$graph_id = api_get_user_id().'AverageResultsVsResource'.$gradebook_id.api_get_course_id();
$data = $DataSet->GetData();
if ($show_draw) {
if ($Cache->IsInCache($graph_id, $DataSet->GetData())) {
//if (0) {
//if we already created the img
//echo 'in cache';
$img_file = $Cache->GetHash($graph_id,$DataSet->GetData());
@ -118,8 +121,14 @@ class FlatViewTable extends SortableTable
// Initialise the graph
$Test = new pChart(760,360);
//which schema of color will be used
$quant_resources = count($data[0])-1;
// Adding the color schemma
$Test->loadColorPalette(api_get_path(LIBRARY_PATH)."pchart/palette/default.txt");
if ($quant_resources < 8) {
$Test->loadColorPalette(api_get_path(LIBRARY_PATH)."pchart/palette/reduced.txt");
} else {
$Test->loadColorPalette(api_get_path(LIBRARY_PATH)."pchart/palette/default.txt");
}
// set font of the axes
$Test->setFontProperties(api_get_path(LIBRARY_PATH)."pchart/fonts/tahoma.ttf",8);
@ -319,6 +328,8 @@ class FlatViewTable extends SortableTable
$i++;
}
} //end foreach
} else {
echo get_lang('ToViewGraphScoreRuleMustBeEnabled');
}
// Pie charts
/*

@ -0,0 +1,7 @@
189,250,75
204,203,81
220,155,87
235,108,92
250,60,98
176,46,224
46,151,224

@ -0,0 +1,5 @@
168,188,56
188,208,76
208,228,96
228,245,116
248,255,136
Loading…
Cancel
Save