Пример #1
0
 protected function draw()
 {
     $this->choosePalette('diem');
     $this->setColorPalette(1, 200, 40, 40);
     $this->setColorPalette(2, 140, 200, 140);
     $this->setColorPalette(0, 40, 60, 200);
     $this->setColorPalette(3, 250, 200, 40);
     $dataSet = new dmChartData();
     $dataSet->AddPoint($this->data['date'], 'date');
     $dataSet->AddPoint($this->data['time'], 'time');
     $dataSet->AddPoint($this->data['nbReq'], 'nbReq');
     $dataSet->AddPoint($this->data['nbErr'], 'nbErr');
     $dataSet->AddPoint($this->data['mem'], 'mem');
     $dataSet->SetSerieName($this->getI18n()->__('Requests per minute'), "nbReq");
     $dataSet->SetSerieName($this->getI18n()->__('Errors per minute'), "nbErr");
     $dataSet->SetSerieName($this->getI18n()->__('Latency in ms'), "time");
     $dataSet->SetSerieName($this->getI18n()->__('Memory used in %'), "mem");
     foreach ($this->eventsFilter as $eventType) {
         $dataSet->AddPoint($this->data['events'][$eventType], $eventType);
     }
     $dataSet->SetSerieName($this->getI18n()->__('Cache cleared'), 'clear cache');
     $dataSet->SetAbsciseLabelSerie('date');
     $dataSet->SetXAxisFormat('date');
     // Prepare the graph area
     $this->setGraphArea(40, 10, $this->getWidth() - 30, $this->getHeight() - 20);
     $this->drawGraphArea(255, 255, 255);
     $dataSet->AddSerie("date");
     $this->clearScale();
     $dataSet->removeAllSeries();
     $dataSet->AddSerie("nbReq");
     $dataSet->AddSerie("nbErr");
     $this->drawRightScale($dataSet->GetData(), $dataSet->GetDataDescription(), SCALE_START0, self::$colors['grey2'][0], self::$colors['grey2'][1], self::$colors['grey2'][2], TRUE, 0, 0, false, 10);
     $this->drawGrid(4, TRUE, self::$colors['grey1'][0], self::$colors['grey1'][1], self::$colors['grey1'][2]);
     $this->drawFilledCubicCurve($dataSet->GetData(), $dataSet->GetDataDescription(), 0.2, 10);
     //    $this->drawFilledLineGraph($dataSet->GetData(),$dataSet->GetDataDescription(), 0.2, 10);
     $this->clearScale();
     $dataSet->removeAllSeries();
     foreach ($this->eventsFilter as $eventType) {
         $dataSet->addSerie($eventType);
     }
     $this->drawScale($dataSet->GetData(), $dataSet->GetDataDescription(), SCALE_START0, 0, 0, 0, false);
     $this->drawStackedBarGraph($dataSet->GetData(), $dataSet->GetDataDescription(), 30, false);
     $this->writeValuesOptions($dataSet->GetData(), $dataSet->GetDataDescription(), 'clear cache', array('>' => 0));
     $this->clearScale();
     $dataSet->removeAllSeries();
     $dataSet->AddSerie("mem");
     $maxMem = 64;
     //(int) ini_get('memory_limit')
     $this->setFixedScale(0, $maxMem);
     $this->drawScale($dataSet->GetData(), $dataSet->GetDataDescription(), SCALE_START0, 0, 0, 0, false, 0, 0, false, 10);
     $this->drawFilledCubicCurve($dataSet->GetData(), $dataSet->GetDataDescription(), 0.2, 20);
     //    $this->drawFilledLineGraph($dataSet->GetData(),$dataSet->GetDataDescription(), 10);
     $this->clearScale();
     $dataSet->removeAllSeries();
     $dataSet->AddSerie("time");
     $dataSet->SetYAxisName($this->getI18n()->__('Latency in ms'));
     $this->drawScale($dataSet->GetData(), $dataSet->GetDataDescription(), SCALE_START0, self::$colors['grey2'][0], self::$colors['grey2'][1], self::$colors['grey2'][2], TRUE, 0, 0, false, 10);
     $this->drawFilledCubicCurve($dataSet->GetData(), $dataSet->GetDataDescription(), 0.2, 30);
     // Add labels
     //    foreach($this->data['events'] as $event)
     //    {
     //      $this->setLabel($dataSet->GetData(), $dataSet->GetDataDescription(), 'time', $event['time'], $event['msg'], 221,230,174);
     //    }
     // Finish the graph
     $this->drawLegend(45, 5, $dataSet->GetDataDescription(), 255, 255, 255);
 }
Пример #2
0
 protected function draw()
 {
     $this->choosePalette('diem');
     $this->setColorPalette(1, 140, 140, 200);
     $this->setColorPalette(0, 140, 200, 140);
     $dataSet = new dmChartData();
     $dataSet->AddPoint($this->data['pageviews'], 'pageviews');
     $dataSet->AddPoint($this->data['visitors'], 'visitors');
     $dataSet->AddPoint($this->data['dates'], 'dates');
     $dataSet->SetAbsciseLabelSerie("dates");
     $dataSet->SetSerieName($this->getI18n()->__('Pages per week'), "pageviews");
     $dataSet->SetSerieName($this->getI18n()->__('Visitors per week'), "visitors");
     // Prepare the graph area
     $this->setGraphArea(80, 10, $this->getWidth() - 80, $this->getHeight() - 20);
     $this->drawGraphArea(255, 255, 255);
     // Draw the pageviews graph
     $dataSet->AddSerie("pageviews");
     $dataSet->SetYAxisName($this->getI18n()->__('Pages per month'));
     $this->drawScale($dataSet->GetData(), $dataSet->GetDataDescription(), SCALE_START0, self::$colors['grey2'][0], self::$colors['grey2'][1], self::$colors['grey2'][2], TRUE, 0, 0, false, 2);
     $this->drawGrid(4, TRUE, self::$colors['grey1'][0], self::$colors['grey1'][1], self::$colors['grey1'][2]);
     $this->setShadowProperties(3, 3, 0, 0, 0, 30, 4);
     $this->drawCubicCurve($dataSet->GetData(), $dataSet->GetDataDescription());
     $this->clearShadow();
     $this->drawFilledCubicCurve($dataSet->GetData(), $dataSet->GetDataDescription(), 0.1, 30);
     $this->drawPlotGraph($dataSet->GetData(), $dataSet->GetDataDescription(), 3, 2, 255, 255, 255);
     // Clear the scale
     $this->clearScale();
     // Draw the 2nd graph
     $dataSet->RemoveAllSeries();
     $dataSet->AddSerie("visitors");
     $dataSet->SetYAxisName($this->getI18n()->__('Visitors per month'));
     $this->drawRightScale($dataSet->GetData(), $dataSet->GetDataDescription(), SCALE_START0, self::$colors['grey2'][0], self::$colors['grey2'][1], self::$colors['grey2'][2], TRUE, 0, 0, false, 2);
     $this->setShadowProperties(3, 3, 0, 0, 0, 30, 4);
     $this->drawCubicCurve($dataSet->GetData(), $dataSet->GetDataDescription());
     $this->clearShadow();
     $this->drawFilledCubicCurve($dataSet->GetData(), $dataSet->GetDataDescription(), 0.1, 20);
     $this->drawPlotGraph($dataSet->GetData(), $dataSet->GetDataDescription(), 3, 2, 255, 255, 255);
     // Finish the graph
     $this->drawLegend(85, 5, $dataSet->GetDataDescription(), 255, 255, 255);
 }
Пример #3
0
 protected function draw()
 {
     for ($it = 0; $it < 2; $it++) {
         $this->Palette = array_merge($this->Palette, $this->Palette);
     }
     $dataSet = new dmChartData();
     foreach ($this->getModules() as $moduleKey => $module) {
         $dataSet->AddPoint($this->data['modules'][$moduleKey], $moduleKey);
         $dataSet->SetSerieName($this->getI18n()->__($module->getPlural()), $moduleKey);
         $dataSet->AddSerie($moduleKey);
     }
     $dataSet->AddPoint($this->data['dates'], 'dm_chart_date');
     $dataSet->SetAbsciseLabelSerie('dm_chart_date');
     // Prepare the graph area
     $this->setGraphArea(40, 0, $this->getWidth(), $this->getHeight() - 20);
     $this->drawScale($dataSet->GetData(), $dataSet->GetDataDescription(), SCALE_ADDALLSTART0, self::$colors['grey2'][0], self::$colors['grey2'][1], self::$colors['grey2'][2], TRUE, 0, 2, TRUE, 3);
     $this->drawGrid(4, TRUE, self::$colors['grey1'][0], self::$colors['grey1'][1], self::$colors['grey1'][2], 50);
     // Draw the 0 line
     //    $this->drawTreshold(0,143,55,72,TRUE,TRUE);
     // Draw the bar graph
     $this->drawStackedBarGraph($dataSet->GetData(), $dataSet->GetDataDescription(), TRUE);
     // Finish the graph
     $this->drawLegend(45, 0, $dataSet->GetDataDescription(), 255, 255, 255);
 }
Пример #4
0
 protected function draw()
 {
     $this->choosePalette('diem');
     $this->setColorPalette(1, 40, 60, 200);
     $this->setColorPalette(0, 140, 200, 140);
     $this->setColorPalette(2, 200, 40, 40);
     $dataSet = new dmChartData();
     $dataSet->AddPoint($this->data['pageviews'], 'pageviews');
     $dataSet->AddPoint($this->data['visits'], 'visits');
     $dataSet->AddPoint($this->data['bounces'], 'bounces');
     //    $dataSet->AddPoint($this->data['pagesPerVisitor'], 'pagesPerVisitor');
     $dataSet->AddPoint($this->data['date'], 'date');
     $dataSet->SetAbsciseLabelSerie("date");
     $dataSet->SetSerieName($this->getI18n()->__('Pages'), "pageviews");
     $dataSet->SetSerieName($this->getI18n()->__('Visitors'), "visits");
     $dataSet->SetSerieName($this->getI18n()->__('Bounce rate'), "bounces");
     //    $dataSet->SetSerieName("per Visitor", "pagesPerVisitor");
     // Prepare the graph area
     $this->setGraphArea(40, 10, $this->getWidth() - 40, $this->getHeight() - 20);
     $this->drawGraphArea(255, 255, 255);
     $dataSet->AddSerie("visits");
     $dataSet->AddSerie("bounces");
     $dataSet->SetYAxisName($this->getI18n()->__('Visitors'));
     $this->setLineStyle(1, 6);
     $this->drawScale($dataSet->GetData(), $dataSet->GetDataDescription(), SCALE_START0, self::$colors['grey2'][0], self::$colors['grey2'][1], self::$colors['grey2'][2], TRUE, 0, 0, false, 1);
     $this->drawGrid(4, TRUE, self::$colors['grey1'][0], self::$colors['grey1'][1], self::$colors['grey1'][2]);
     $this->drawLineGraph($dataSet->GetData(), $dataSet->GetDataDescription());
     $this->drawPlotGraph($dataSet->GetData(), $dataSet->GetDataDescription(), 3, 2, 255, 255, 255);
     $this->drawArea($dataSet->GetData(), "visits", "bounces", self::$colors['blue'][0], self::$colors['blue'][1], self::$colors['blue'][2], 50);
     //    $this->clearScale();
     //    $dataSet->removeAllSeries();
     //    $dataSet->AddSerie("Visits");
     //    $this->drawScale($dataSet->GetData(),$dataSet->GetDataDescription(),SCALE_NORMAL, self::$colors['grey2'][0], self::$colors['grey2'][1], self::$colors['grey2'][2],TRUE,0,0, false, 1);
     //    $this->drawFilledLineGraph($dataSet->GetData(),$dataSet->GetDataDescription(), 10);
     //    $this->drawPlotGraph($dataSet->GetData(),$dataSet->GetDataDescription(),3,2,255,255,255);
     //    $this->clearScale();
     //
     //    $dataSet->removeAllSeries();
     //    $dataSet->AddSerie("pageviews");
     //    $dataSet->SetYAxisName("pageviews");
     //    $this->drawRightScale($dataSet->GetData(),$dataSet->GetDataDescription(),SCALE_NORMAL, self::$colors['grey2'][0], self::$colors['grey2'][1], self::$colors['grey2'][2],TRUE,0,0, false, 1);
     //    $this->drawFilledLineGraph($dataSet->GetData(),$dataSet->GetDataDescription(), 10);
     //    $this->drawPlotGraph($dataSet->GetData(),$dataSet->GetDataDescription(),3,2,255,255,255);
     //
     // Clear the scale
     $this->clearScale();
     // Draw the 2nd graph
     $dataSet->removeAllSeries();
     $dataSet->AddSerie("pageviews");
     //$dataSet->SetYAxisName($this->getI18n()->__('Pages'));
     $this->setLineStyle(1, 6);
     $this->setLineStyle(1, 1);
     $this->drawRightScale($dataSet->GetData(), $dataSet->GetDataDescription(), SCALE_START0, self::$colors['grey2'][0], self::$colors['grey2'][1], self::$colors['grey2'][2], TRUE, 0, 0, false, 1);
     //    $this->drawCubicCurve($dataSet->GetData(),$dataSet->GetDataDescription(), .1);
     //    $this->drawPlotGraph($dataSet->GetData(),$dataSet->GetDataDescription(),3,2,255,255,255);
     $this->drawBarGraph($dataSet->GetData(), $dataSet->GetDataDescription(), false, 30);
     $this->writeValues($dataSet->GetData(), $dataSet->GetDataDescription(), 'pageviews');
     // Clear the scale
     //    $this->clearScale();
     // Draw the 2nd graph
     //    $dataSet->removeAllSeries();
     //    $dataSet->AddSerie("pagesPerVisitor");
     //    $this->setLineStyle(1, 1);
     //    $this->drawRightScale($dataSet->GetData(),$dataSet->GetDataDescription(),SCALE_NORMAL, self::$colors['grey2'][0], self::$colors['grey2'][1], self::$colors['grey2'][2],TRUE,0,0, false, 1);
     //    $this->drawLineGraph($dataSet->GetData(),$dataSet->GetDataDescription());
     // Finish the graph
     $dataSet->addAllSeries();
     $dataSet->RemoveSerie('date');
     $this->drawLegend(45, 5, $dataSet->GetDataDescription(), 255, 255, 255);
 }
Пример #5
0
 protected function draw()
 {
     $dataSet = new dmChartData();
     $dataSet->AddPoint($this->data['name']['pageviews'], 'namePageviews');
     $dataSet->AddPoint($this->data['name']['browser'], 'nameBrowser');
     $dataSet->AddPoint($this->data['ieVersion']['pageviews'], 'ieVersionPageviews');
     $dataSet->AddPoint($this->data['ieVersion']['browserVersion'], 'ieVersionBrowserVersion');
     $dataSet->SetSerieName('Pageviews', 'namePageviews');
     $dataSet->SetSerieName('Browser', 'nameBrowser');
     $dataSet->SetSerieName('Pageviews', 'ieVersionPageviews');
     $dataSet->SetSerieName('IE version', 'ieVersionBrowserVersion');
     $dataSet->addSerie('namePageviews');
     $dataSet->addSerie('nameBrowser');
     $dataSet->SetAbsciseLabelSerie("nameBrowser");
     // Prepare the graph area
     $this->setGraphArea(0, 0, $this->getWidth(), $this->getHeight());
     // Draw the pie chart
     $radius = $this->getHeight() / 1.9;
     $this->drawPieGraph($dataSet->GetData(), $dataSet->GetDataDescription(), $radius * 1.2, $radius / 1.25, $radius, PIE_PERCENTAGE, TRUE, 70, 40, 8);
     $this->drawPieLegend($this->getWidth() - 90, 5, $dataSet->GetData(), $dataSet->GetDataDescription(), 250, 250, 250);
     $this->choosePalette(6);
     $dataSet->removeAllSeries();
     $dataSet->addSerie('ieVersionPageviews');
     $dataSet->addSerie('ieVersionBrowserVersion');
     $dataSet->SetAbsciseLabelSerie("ieVersionBrowserVersion");
     // Draw the pie chart
     $radius = $this->getHeight() / 5;
     $this->drawPieGraph($dataSet->GetData(), $dataSet->GetDataDescription(), $this->getWidth() - $radius * 1.5, $this->getHeight() - $radius * 1.3 - 15, $radius, PIE_PERCENTAGE, TRUE, 70, 20, 5);
     $this->drawTitle($this->getWidth() - 120, $this->getHeight() - 10, 'Internet Explorer', self::$colors['grey3'][0], self::$colors['grey3'][1], self::$colors['grey3'][2]);
     $data = $dataSet->getData();
     foreach ($data as $index => $value) {
         if (!isset($value['ieVersionBrowserVersion'])) {
             unset($data[$index]);
         }
     }
     $this->drawPieLegend($this->getWidth() - 90, $this->getHeight() / 3, $data, $dataSet->GetDataDescription(), 250, 250, 250);
 }