Exemplo n.º 1
0
 function customizeChartProperties()
 {
     $this->chart->set_number_format($num_decimals = 0, $is_fixed_num_decimals_forced = true, $is_decimal_separator_comma = false, $is_thousand_separator_disabled = false);
     $gridColour = '#E0E1E4';
     $countValues = count($this->xLabels);
     $this->maxValue = $this->getMaxValue();
     $this->minValue = 0;
     // X Axis
     $this->x = new x_axis();
     $this->x->set_colour('#596171');
     $this->x->set_grid_colour($gridColour);
     $this->x->set_steps($this->xSteps);
     // X Axis Labels
     $this->x_labels = new x_axis_labels();
     $this->x_labels->set_size(11);
     //manually fix the x labels step as this doesn't work in this OFC release..
     $xLabelsStepped = $this->xLabels;
     foreach ($xLabelsStepped as $i => &$xLabel) {
         if ($i % $this->xSteps != 0) {
             $xLabel = '';
         }
     }
     $this->x_labels->set_labels($xLabelsStepped);
     $this->x_labels->set_steps(1);
     $this->x->set_labels($this->x_labels);
     // Y Axis
     $this->y = new y_axis();
     $this->y->set_colour('#ffffff');
     $this->y->set_grid_colour($gridColour);
     $stepsCount = 2;
     $stepsEveryNLabel = ceil(($this->maxValue - $this->minValue) / $stepsCount);
     if ($this->maxValue == 0) {
         $this->maxValue = 1;
     }
     $this->y->set_range($this->minValue, (int) ceil($this->maxValue), (int) $stepsEveryNLabel);
     $dataSetsToDisplay = $this->getDataSetsToDisplay();
     if ($dataSetsToDisplay != false) {
         $dataSetToDisplay = current($dataSetsToDisplay);
         $this->y->set_label_text("#val#" . $this->yUnit);
     }
     // Tooltip
     $this->tooltip = new tooltip();
     $this->tooltip->set_shadow(true);
     $this->tooltip->set_stroke(1);
     $this->tooltip->set_colour("#B4B09C");
     $this->tooltip->set_background_colour("#F9FAFA");
     $this->tooltip->set_title_style("{font-size: 14px; font-family:Arial; font-weight:bold; color: #7E735A;}");
     $this->tooltip->set_body_style("{font-size: 14px; font-family:Arial; color: #000000;} ");
     // Attach elements to the graph
     $this->chart->set_x_axis($this->x);
     $this->chart->set_y_axis($this->y);
     $this->chart->set_tooltip($this->tooltip);
     $this->chart->set_bg_colour('#ffffff');
 }
Exemplo n.º 2
0
 function render()
 {
     return parent::render();
 }