当前位置: 首页>>代码示例>>PHP>>正文


PHP pChart::drawLineGraph方法代码示例

本文整理汇总了PHP中pChart::drawLineGraph方法的典型用法代码示例。如果您正苦于以下问题:PHP pChart::drawLineGraph方法的具体用法?PHP pChart::drawLineGraph怎么用?PHP pChart::drawLineGraph使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在pChart的用法示例。


在下文中一共展示了pChart::drawLineGraph方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: drawChart

function drawChart($title, $DataSet, $type, $colors, $legend = false)
{
    // Initialise the graph
    $Chart = new pChart(1300, 700);
    $Chart->setFontProperties("Fonts/tahoma.ttf", 8);
    $Chart->setGraphArea(50, 50, 1200, 600);
    $Chart->drawGraphArea(255, 255, 255, TRUE);
    $Chart->drawScale($DataSet->GetData(), $DataSet->GetDataDescription(), SCALE_NORMAL, 150, 150, 150, TRUE, 0, 0, TRUE);
    // Draw the 0 line
    $Chart->setFontProperties("Fonts/tahoma.ttf", 6);
    $Chart->drawTreshold(0, 143, 55, 72, TRUE, TRUE);
    foreach ($colors as $idx => $color) {
        $Chart->setColorPalette($idx, $color[0], $color[1], $color[2]);
    }
    if ($type == "bar") {
        $Chart->drawBarGraph($DataSet->GetData(), $DataSet->GetDataDescription());
    } else {
        if ($type == "line") {
            $Chart->drawLineGraph($DataSet->GetData(), $DataSet->GetDataDescription());
        }
    }
    if ($legend) {
        $Chart->drawLegend(465, 40, $DataSet->GetDataDescription(), 255, 255, 255);
    }
    // Finish the graph
    $Chart->setFontProperties("Fonts/tahoma.ttf", 10);
    $Chart->drawTitle(60, 22, $title, 50, 50, 50, 530);
    $Chart->Stroke();
}
开发者ID:FigBug,项目名称:GamenightEx,代码行数:29,代码来源:graphfunclarge.php

示例2: generateGraph

function generateGraph($year, $month, $quarter, $biAnn, $dev, $patna, $duration, $from, $to)
{
    $myarr = graphTests($year, $month, $quarter, $biAnn, $dev, $patna, $duration, $from, $to);
    $myarr1 = graphErrs($year, $month, $quarter, $biAnn, $dev, $patna, $duration, $from, $to);
    $myarr2 = graphLbls($year, $month, $quarter, $biAnn, $dev, $patna, $duration, $from, $to);
    // Standard inclusions
    include "pChart/pChart/pData.class";
    include "pChart/pChart/pChart.class";
    // Dataset definition
    $DataSet = new pData();
    $DataSet->AddPoint($myarr, "Serie1");
    $DataSet->AddPoint($myarr1, "Serie2");
    $DataSet->AddPoint($myarr2, "Serie3");
    $DataSet->AddSerie("Serie1");
    $DataSet->AddSerie("Serie2");
    $DataSet->SetAbsciseLabelSerie("Serie3");
    $DataSet->SetSerieName("Test Resulting trends", "Serie1");
    $DataSet->SetSerieName("Errors in tests", "Serie2");
    $DataSet->SetYAxisName("Tests");
    // $DataSet->SetYAxisFormat("time");
    $DataSet->SetXAxisName("months");
    // Initialise the graph
    $Test = new pChart(750, 330);
    $Test->setFontProperties("Fonts/tahoma.ttf", 8);
    $Test->setGraphArea(85, 30, 650, 200);
    $Test->drawFilledRoundedRectangle(7, 7, 693, 223, 5, 240, 240, 240);
    $Test->drawRoundedRectangle(5, 5, 695, 225, 5, 230, 230, 230);
    $Test->drawGraphArea(255, 255, 255, TRUE);
    $Test->drawScale($DataSet->GetData(), $DataSet->GetDataDescription(), SCALE_NORMAL, 150, 150, 150, TRUE, 0, 2);
    $Test->drawGrid(4, TRUE, 230, 230, 230, 50);
    // Draw the 0 line
    $Test->setFontProperties("Fonts/tahoma.ttf", 6);
    $Test->drawTreshold(0, 143, 55, 72, TRUE, TRUE);
    // Draw the line graph
    $Test->drawLineGraph($DataSet->GetData(), $DataSet->GetDataDescription());
    $Test->drawPlotGraph($DataSet->GetData(), $DataSet->GetDataDescription(), 3, 2, 255, 255, 255);
    // Finish the graph
    $Test->setFontProperties("Fonts/tahoma.ttf", 8);
    $Test->drawLegend(90, 35, $DataSet->GetDataDescription(), 255, 255, 255);
    $Test->setFontProperties("Fonts/tahoma.ttf", 10);
    $Test->drawTitle(60, 22, "Test Summary", 50, 50, 50, 585);
    $Test->Render("mpdf.png");
}
开发者ID:OmondiKevin,项目名称:CD4,代码行数:43,代码来源:mailpdf.php

示例3: index

 function index()
 {
     $this->load->model('charge_model');
     $revenue = $this->charge_model->GetRevenueByDay($this->user->Get('client_id'));
     $data = array();
     if ($this->config->item('show_dashboard_chart') !== 'no' and !empty($revenue) and count($revenue) > 1) {
         $series = array();
         foreach ($revenue as $day) {
             $series[] = $day['revenue'];
             $series2[] = date("M j", strtotime($day['day']));
         }
         include APPPATH . 'libraries/pchart/pData.class';
         include APPPATH . 'libraries/pchart/pChart.class';
         // Dataset definition
         $DataSet = new pData();
         $DataSet->AddPoint($series, "Revenue");
         $DataSet->AddPoint($series2, "Serie2");
         $DataSet->AddAllSeries();
         $DataSet->SetAbsciseLabelSerie("Serie2");
         $DataSet->RemoveSerie("Serie2");
         $DataSet->SetXAxisName('Date');
         $DataSet->SetYAxisName('Revenue');
         //$DataSet->SetXAxisFormat('date');
         // Initialise the graph
         $Test = new pChart(1000, 260);
         $Test->setFontProperties(APPPATH . 'libraries/pchart/Arial.ttf', 10);
         $Test->setGraphArea(90, 30, 960, 200);
         $Test->drawGraphArea(252, 252, 252);
         $Test->drawScale($DataSet->GetData(), $DataSet->GetDataDescription(), SCALE_NORMAL, 150, 150, 150, TRUE, 0, 2);
         $Test->drawGrid(4, TRUE, 230, 230, 230, 255);
         // Draw the line graph
         $Test->drawLineGraph($DataSet->GetData(), $DataSet->GetDataDescription());
         $Test->drawPlotGraph($DataSet->GetData(), $DataSet->GetDataDescription(), 3, 2, 255, 255, 255);
         // Finish the graph
         $Test->setFontProperties(APPPATH . 'libraries/pchart/Arial.ttf', 8);
         $Test->drawLegend(45, 35, $DataSet->GetDataDescription(), 255, 255, 255);
         $Test->setFontProperties(APPPATH . 'libraries/pchart/Arial.ttf', 10);
         //$Test->drawTitle(60,22,"Last 30 Days",50,50,50,585);
         $Test->Render(BASEPATH . '../writeable/rev_chart_' . $this->user->Get('client_id') . '.png');
     } else {
         $data['no_chart'] = 'true';
     }
     // get log
     $this->load->model('log_model');
     $log = $this->log_model->GetClientLog($this->user->Get('client_id'));
     $data['log'] = $log;
     $this->load->view(branded_view('cp/dashboard'), $data);
 }
开发者ID:carriercomm,项目名称:opengateway,代码行数:48,代码来源:dashboard.php

示例4: dashboardwiki

 public function dashboardwiki()
 {
     $hours = $this->from == $this->to;
     $result = $this->hlp->Query()->dashboardwiki($this->tlimit, $hours);
     $data1 = array();
     $data2 = array();
     $data3 = array();
     $times = array();
     foreach ($result as $time => $row) {
         $data1[] = (int) $row['E'];
         $data2[] = (int) $row['C'];
         $data3[] = (int) $row['D'];
         $times[] = $time . ($hours ? 'h' : '');
     }
     $DataSet = new pData();
     $DataSet->AddPoints($data1, 'Serie1');
     $DataSet->AddPoints($data2, 'Serie2');
     $DataSet->AddPoints($data3, 'Serie3');
     $DataSet->AddPoints($times, 'Times');
     $DataSet->AddAllSeries();
     $DataSet->SetAbscissaLabelSeries('Times');
     $DataSet->SetSeriesName($this->hlp->getLang('graph_edits'), 'Serie1');
     $DataSet->SetSeriesName($this->hlp->getLang('graph_creates'), 'Serie2');
     $DataSet->SetSeriesName($this->hlp->getLang('graph_deletions'), 'Serie3');
     $Canvas = new GDCanvas(700, 280, false);
     $Chart = new pChart(700, 280, $Canvas);
     $Chart->setFontProperties(dirname(__FILE__) . '/pchart/Fonts/DroidSans.ttf', 8);
     $Chart->setGraphArea(50, 10, 680, 200);
     $Chart->drawScale($DataSet, new ScaleStyle(SCALE_NORMAL, new Color(127)), $hours ? 0 : 45, 1, false, ceil(count($times) / 12));
     $Chart->drawLineGraph($DataSet->GetData(), $DataSet->GetDataDescription());
     $DataSet->removeSeries('Times');
     $DataSet->removeSeriesName('Times');
     $Chart->drawLegend(550, 15, $DataSet->GetDataDescription(), new Color(250));
     header('Content-Type: image/png');
     $Chart->Render('');
 }
开发者ID:splitbrain,项目名称:dokuwiki-plugin-statistics,代码行数:36,代码来源:StatisticsGraph.class.php

示例5: _createVisitsGraph

 protected function _createVisitsGraph()
 {
     // load pChart graphic library
     $this->_loadLibs();
     // définition des données à afficher
     $dataSet = new pData();
     // need config, to know which data user wants to display : visits, unique visitors, pageviews
     $sefConfig = Sh404sefFactory::getConfig();
     $dataTypeString = str_replace('ga:', '', $sefConfig->analyticsDashboardDataType);
     // get data from response
     $data = array();
     $maxY = 0;
     foreach ($this->_rawData['visits'] as $entry) {
         $data[] = $entry->{$dataTypeString};
         if ($entry->{$dataTypeString} > $maxY) {
             $maxY = $entry->{$dataTypeString};
         }
     }
     // format dates
     $dates = Sh404sefHelperAnalytics::formatAbciseDates($this->_rawData['visits'], $this->_options);
     $dataSet->AddPoint($data, $dataTypeString);
     $dataSet->AddPoint($dates, "dates");
     $dataSet->addSerie($dataTypeString);
     $dataSet->SetAbsciseLabelSerie("dates");
     $label = JText::_('COM_SH404SEF_ANALYTICS_DATA_' . strtoupper($dataTypeString));
     $dataSet->SetSerieName($label, $dataTypeString);
     // Initialise the graph
     $w = $this->_options['cpWidth'];
     $w = empty($w) ? 400 : intval($w - 40);
     $h = 225;
     $centreX = intval(0.5 * $w);
     $centreY = intval(0.5 * $h);
     $chart = new pChart($w, $h);
     $fontSize = 8;
     // calculate left margin based on max value to display
     $leftMargin = 20 + $fontSize + 20 + $fontSize * strlen($maxY);
     $bottomMargin = 5 + $fontSize * 6;
     switch ($this->_options['groupBy']) {
         case 'ga:year,ga:month,ga:week,ga:day':
             $YAxisName = JText::_('Day');
             break;
             // date string represents a week number
         // date string represents a week number
         case 'ga:year,ga:month,ga:week':
             $YAxisName = JText::_('Week');
             break;
         case 'ga:year,ga:month':
             $YAxisName = JText::_('Month');
             break;
     }
     $dataSet->SetYAxisName($label . JText::_('COM_SH404SEF_ANALYTICS_REPORT_PER_LABEL') . $YAxisName);
     $chart->setFontProperties($this->_baseChartPath . DS . 'Fonts/arial.ttf', $fontSize);
     $chart->setGraphArea($leftMargin, 30, $w - 20, $h - $bottomMargin);
     $chart->drawFilledRoundedRectangle(7, 7, $w - 7, $h - 7, 5, 240, 240, 240);
     $chart->drawRoundedRectangle(5, 5, $w - 5, $h - 5, 5, 230, 230, 230);
     $chart->drawGraphArea(255, 255, 255, TRUE);
     $d = $dataSet->GetData();
     if (!empty($d)) {
         $chart->drawScale($d, $dataSet->GetDataDescription(), SCALE_NORMAL, 150, 150, 150, TRUE, 60, 0, false);
         $chart->drawGrid(4, TRUE, 230, 230, 230, 50);
         // Draw the 0 line
         $chart->setFontProperties($this->_baseChartPath . DS . 'Fonts/arial.ttf', $fontSize);
         $chart->drawTreshold(0, 143, 55, 72, TRUE, TRUE);
         // Draw the line graph
         $chart->drawLineGraph($d, $dataSet->GetDataDescription());
         $chart->drawPlotGraph($d, $dataSet->GetDataDescription(), 3, 2, 255, 255, 255);
     }
     // create a temporary file for
     $user =& JFactory::getUser();
     // make sure the root tmp dir exists
     $rootDir = 'tmp' . DS . 'sh404sef_analytics';
     Sh404sefHelperFiles::createDirAndIndex(JPATH_ROOT . DS . $rootDir);
     // file name is per user
     $basePath = $rootDir . DS . md5('useless_' . $user->id . '_hashing') . DS;
     // create path and make sure there's an index.html file in it
     Sh404sefHelperFiles::createDirAndIndex(JPATH_ROOT . DS . $basePath);
     $imageFileName = Sh404sefHelperAnalytics::createTempFile($basePath, $this->_options['report'] . '.' . $this->_options['accountId'] . '.visits.' . $dataTypeString);
     $chart->Render(JPATH_ROOT . DS . $imageFileName);
     // need cleaning up, so let's remove all report files for that user older than an hour or so
     Sh404sefHelperAnalytics::cleanReportsImageFiles(JPATH_ROOT . DS . $basePath, $age = 4000);
     return JURI::root() . $imageFileName;
 }
开发者ID:lautarodragan,项目名称:ideary,代码行数:82,代码来源:analyticsgareportdashboard.php

示例6: showGraph

 function showGraph($searchInfo = '')
 {
     $conditions = empty($searchInfo['keywordId']) ? "" : " and s.keyword_id=" . intval($searchInfo['keywordId']);
     $conditions .= empty($searchInfo['seId']) ? "" : " and s.searchengine_id=" . intval($searchInfo['seId']);
     $sql = "select s.*,se.domain \r\n\t\t\t\t\tfrom searchresults s,searchengines se  \r\n\t\t\t\t\twhere s.searchengine_id=se.id \r\n\t\t\t\t\tand time>= " . intval($searchInfo['fromTime']) . " and time<" . intval($searchInfo['toTime']) . " {$conditions}  \r\n\t\t\t\t\torder by s.time";
     $repList = $this->db->select($sql);
     $reportList = array();
     $seList = array();
     foreach ($repList as $repInfo) {
         $var = $repInfo['searchengine_id'] . $repInfo['keyword_id'] . $repInfo['time'];
         if (empty($reportList[$var])) {
             $reportList[$var] = $repInfo;
         } else {
             if ($repInfo['rank'] < $reportList[$var]['rank']) {
                 $reportList[$var] = $repInfo;
             }
         }
         if (empty($seList[$repInfo['searchengine_id']])) {
             $seList[$repInfo['searchengine_id']] = $repInfo['domain'];
         }
     }
     asort($seList);
     $dataList = array();
     $maxValue = 0;
     foreach ($reportList as $repInfo) {
         $seId = $repInfo['searchengine_id'];
         $dataList[$repInfo['time']][$seId] = $repInfo['rank'];
         $maxValue = $repInfo['rank'] > $maxValue ? $repInfo['rank'] : $maxValue;
     }
     // check whether the records are available for drawing graph
     if (empty($dataList) || empty($maxValue)) {
         $kpText = $_SESSION['lang_code'] == 'ja' ? $_SESSION['text']['common']['No Records Found'] . "!" : "No Records Found!";
         $this->showMessageAsImage($kpText);
     }
     # Dataset definition
     $dataSet = new pData();
     foreach ($dataList as $dataInfo) {
         $i = 1;
         foreach ($seList as $seId => $seVal) {
             $val = empty($dataInfo[$seId]) ? 0 : $dataInfo[$seId];
             $dataSet->AddPoint($val, "Serie" . $i++);
         }
     }
     $i = 1;
     foreach ($seList as $seDomain) {
         $dataSet->AddSerie("Serie{$i}");
         $dataSet->SetSerieName($seDomain, "Serie{$i}");
         $i++;
     }
     $serieCount = count($seList) + 1;
     $dataSet->AddPoint(array_keys($dataList), "Serie{$serieCount}");
     $dataSet->SetAbsciseLabelSerie("Serie{$serieCount}");
     # if language is japanese
     if ($_SESSION['lang_code'] == 'ja') {
         $fontFile = "fonts/M+1P+IPAG.ttf";
         $dataSet->SetXAxisName($_SESSION['text']['common']["Date"]);
         $dataSet->SetYAxisName($_SESSION['text']['common']["Rank"]);
     } else {
         $fontFile = "fonts/tahoma.ttf";
         $dataSet->SetXAxisName("Date");
         $dataSet->SetYAxisName("Rank");
     }
     $dataSet->SetXAxisFormat("date");
     # Initialise the graph
     $chart = new pChart(720, 520);
     $chart->setFixedScale($maxValue, 1);
     $chart->setFontProperties($fontFile, 8);
     $chart->setGraphArea(85, 30, 670, 425);
     $chart->drawFilledRoundedRectangle(7, 7, 713, 513, 5, 240, 240, 240);
     $chart->drawRoundedRectangle(5, 5, 715, 515, 5, 230, 230, 230);
     $chart->drawGraphArea(255, 255, 255, TRUE);
     $chart->drawScale($dataSet->GetData(), $dataSet->GetDataDescription(), SCALE_NORMAL, 150, 150, 150, TRUE, 90, 2);
     $chart->drawGrid(4, TRUE, 230, 230, 230, 50);
     # Draw the 0 line
     $chart->setFontProperties($fontFile, 6);
     $chart->drawTreshold(0, 143, 55, 72, TRUE, TRUE);
     # Draw the line graph
     $chart->drawLineGraph($dataSet->GetData(), $dataSet->GetDataDescription());
     $chart->drawPlotGraph($dataSet->GetData(), $dataSet->GetDataDescription(), 3, 2, 255, 255, 255);
     $j = 1;
     $chart->setFontProperties($fontFile, 10);
     foreach ($seList as $seDomain) {
         $chart->writeValues($dataSet->GetData(), $dataSet->GetDataDescription(), "Serie" . $j++);
     }
     # Finish the graph
     $chart->setFontProperties("fonts/tahoma.ttf", 8);
     $chart->drawLegend(90, 35, $dataSet->GetDataDescription(), 255, 255, 255);
     $chart->setFontProperties($fontFile, 10);
     $kpText = $_SESSION['lang_code'] == 'ja' ? $this->spTextKeyword["Keyword Position Report"] : "Keyword Position Report";
     $chart->drawTitle(60, 22, $kpText, 50, 50, 50, 585);
     $chart->stroke();
 }
开发者ID:codegooglecom,项目名称:seopanel,代码行数:92,代码来源:report.ctrl.php

示例7: accessgraph

 /**
  * Draws a line or bargraph depending on the number of data points
  *
  * @param string $title the graph's title
  * @param array  $axis the axis points
  * @param array  $labels the labels for the datasets
  * @param array  $datasets any number of data arrays
  */
 private function accessgraph($title, $axis, $labels, $datasets)
 {
     if (!count($axis)) {
         $this->nograph($title . ': no data');
         return;
     }
     // add the data and labels
     $DataSet = new pData();
     foreach ($datasets as $num => $set) {
         $DataSet->AddPoints($set, "series{$num}");
         $DataSet->SetSeriesName($labels[$num], "series{$num}");
     }
     // setup axis
     $DataSet->AddPoints($axis, 'times');
     $DataSet->AddAllSeries();
     $DataSet->SetAbscissaLabelSeries('times');
     $DataSet->removeSeries('times');
     $DataSet->removeSeriesName('times');
     $Canvas = new GDCanvas(600, 300, false);
     $Chart = new pChart(600, 300, $Canvas);
     $usebargraph = count($axis) < 10;
     $Chart->setFontProperties(dirname(__FILE__) . '/../pchart/Fonts/DroidSans.ttf', 8);
     $Chart->setGraphArea(50, 40, 500, 200);
     $Chart->drawScale($DataSet, new ScaleStyle(SCALE_NORMAL, new Color(127)), 45, 1, $usebargraph);
     if ($usebargraph) {
         $Chart->drawBarGraph($DataSet->GetData(), $DataSet->GetDataDescription());
     } else {
         $Chart->drawLineGraph($DataSet->GetData(), $DataSet->GetDataDescription());
     }
     $Chart->drawLegend(500, 40, $DataSet->GetDataDescription(), new Color(250));
     $Chart->setFontProperties(dirname(__FILE__) . '/../pchart/Fonts/DroidSans.ttf', 12);
     $Chart->drawTitle(10, 10, $title, new Color(0), 590, 30);
     $Chart->Render(null);
 }
开发者ID:omusico,项目名称:isle-web-framework,代码行数:42,代码来源:graph.php

示例8: componentLineGraph

 public function componentLineGraph()
 {
     $DataSet = new pData();
     $maxvals = array();
     foreach ($this->datasets as $ds_id => $dataset) {
         $DataSet->AddPoint($dataset['values'], "Serie" . $ds_id, array_keys($dataset['values']));
         $maxvals[] = max($dataset['values']);
         if (isset($dataset['burndown'])) {
             $amount = count($dataset['values']) > 1 ? $dataset['burndown']['maxEstimation'] / (count($dataset['values']) - 1) : 0;
             for ($i = 0; $i < count($dataset['values']); $i++) {
                 $burndownValues[] = $dataset['burndown']['maxEstimation'] - $i * $amount;
             }
             $DataSet->AddPoint($burndownValues, "Burndown" . $ds_id, $dataset['burndown']['maxEstimation']);
         }
     }
     $DataSet->AddAllSeries();
     if (isset($this->labels)) {
         $DataSet->AddPoint($this->labels, "Labels");
         $DataSet->SetAbsciseLabelSerie("Labels");
     } else {
         $DataSet->SetAbsciseLabelSerie();
     }
     foreach ($this->datasets as $ds_id => $dataset) {
         $DataSet->SetSerieName($dataset['label'], "Serie" . $ds_id);
         if (isset($dataset['burndown'])) {
             $DataSet->SetSerieName($dataset['burndown']['label'], "Burndown" . $ds_id);
         }
     }
     if (isset($this->values_title)) {
         $DataSet->SetYAxisName($this->values_title);
     }
     if (isset($this->labels_title)) {
         $DataSet->SetXAxisName($this->labels_title);
     }
     // Initialise the graph
     $Test = new pChart($this->width, $this->height);
     $Test->setFixedScale(0, ceil(max($maxvals) / 5) * 5);
     $Test->setFontProperties(THEBUGGENIE_MODULES_PATH . 'pchart' . DS . 'fonts' . DS . 'DroidSans.ttf', 8);
     if (isset($this->labels_title)) {
         $Test->setGraphArea(50, 30, $this->width - 30, $this->height - 45);
     } else {
         $Test->setGraphArea(50, 30, $this->width - 30, $this->height - 30);
     }
     $Test->drawFilledRoundedRectangle(2, 2, $this->width - 3, $this->height - 3, 5, 240, 240, 240);
     $Test->drawRoundedRectangle(0, 0, $this->width - 1, $this->height - 1, 5, 230, 230, 230);
     $Test->drawGraphArea(255, 255, 255, TRUE);
     $Test->drawScale($DataSet->GetData(), $DataSet->GetDataDescription(), SCALE_NORMAL, 150, 150, 150, TRUE, 0, 2);
     $Test->drawGrid(4, TRUE, 230, 230, 230, 50);
     // Draw the 0 line
     $Test->setFontProperties(THEBUGGENIE_MODULES_PATH . 'pchart' . DS . 'fonts' . DS . 'DroidSans.ttf', 6);
     $Test->drawTreshold(0, 143, 55, 72, TRUE, TRUE);
     // Draw the cubic curve graph
     if (isset($this->style) && $this->style == 'curved') {
         $Test->drawCubicCurve($DataSet->GetData(), $DataSet->GetDataDescription());
     } elseif (isset($this->style) && $this->style == 'filled_line') {
         $Test->drawFilledLineGraph($DataSet->GetData(), $DataSet->GetDataDescription(), 50, true);
     } elseif (isset($this->style) && $this->style == 'stacked_bar') {
         $Test->drawStackedBarGraph($DataSet->GetData(), $DataSet->GetDataDescription(), 50, true);
     } elseif (isset($this->style) && $this->style == 'single_bar') {
         $Test->drawBarGraph($DataSet->GetData(), $DataSet->GetDataDescription(), TRUE);
     } else {
         $Test->drawLineGraph($DataSet->GetData(), $DataSet->GetDataDescription());
     }
     if (isset($this->include_plotter) && $this->include_plotter) {
         $Test->drawPlotGraph($DataSet->GetData(), $DataSet->GetDataDescription(), 3, 2, 255, 255, 255);
     }
     // Finish the graph
     $Test->setFontProperties(THEBUGGENIE_MODULES_PATH . 'pchart' . DS . 'fonts' . DS . 'DroidSans.ttf', 8);
     //$Test->drawLegend(600, 30, $DataSet->GetDataDescription(), 255, 255, 255);
     $Test->drawLegend(55, 35, $DataSet->GetDataDescription(), 255, 255, 255);
     $Test->setFontProperties(THEBUGGENIE_MODULES_PATH . 'pchart' . DS . 'fonts' . DS . 'DroidSansBold.ttf', 10);
     $Test->drawTitle(50, 22, $this->title, 50, 50, 50, $this->width - 30);
     $Test->Stroke();
     //("example2.png");
 }
开发者ID:ronaldbroens,项目名称:thebuggenie,代码行数:75,代码来源:actioncomponents.class.php

示例9: getChart

 /**
  * @author Patrick plichart
  * @param string localgraphid an identifier for the graph to be displayed
  * @param array $datax	a flat sery of x labels
  * @param array $setOfySeries	an array of y series to be drawn (needs to be consistent with xsery), keys indicates the legend title
  * @param string $title the title of the graph
  * @param string xAxisLabel label of the x Axis
  * @param string yAxisLabel label of the y Axis
  * @return string the url of the generated graph
  */
 private function getChart($localGraphId, $datax, $setOfySeries, $title, $type = "bar", $xAxisLabel = "", $yAxisLabel = "", $r = "208", $g = "2", $b = "57")
 {
     // Dataset definition
     if (count($datax) == 0) {
         throw new \common_exception_NoContent("Empty data set");
     }
     $dataSet = new \pData();
     foreach ($setOfySeries as $legend => $ysery) {
         $dataSet->AddPoint($ysery, $legend);
         $dataSet->SetSerieName($legend, $legend);
     }
     $dataSet->AddAllSeries();
     $dataSet->AddPoint($datax, "xLabels");
     $dataSet->SetYAxisName($yAxisLabel);
     $dataSet->SetXAxisName($xAxisLabel);
     $dataSet->SetAbsciseLabelSerie("xLabels");
     // Initialise the graph
     $graph = new \pChart(490, 260);
     $graph->createColorGradientPalette($r, $g, $b, $r, $g, $b, 5);
     // aa is way too slow here
     $graph->Antialias = false;
     $graph->setFontProperties(fontName, 8);
     $graph->setGraphArea(55, 40, 450, 200);
     // draw the background rectangle
     $graph->drawFilledRoundedRectangle(7, 7, 655, 253, 5, 240, 240, 240);
     $graph->drawRoundedRectangle(5, 5, 655, 225, 5, 230, 230, 230);
     $graph->drawGraphArea(255, 255, 255, true);
     $graph->drawScale($dataSet->GetData(), $dataSet->GetDataDescription(), SCALE_START0, 150, 150, 150, true, 0, 2, true);
     $graph->drawGrid(4, true, 230, 230, 230, 50);
     // Draw the 0 line
     $graph->setFontProperties(fontName, 6);
     $graph->drawTreshold(0, 143, 55, 72, true, true);
     // Draw the bar graph
     switch ($type) {
         case "bar":
             $graph->drawBarGraph($dataSet->GetData(), $dataSet->GetDataDescription(), true);
             break;
         case "line":
             $graph->drawLineGraph($dataSet->GetData(), $dataSet->GetDataDescription());
             $graph->drawPlotGraph($dataSet->GetData(), $dataSet->GetDataDescription(), 3, 2, 255, 255, 255);
             break;
     }
     // Finish the graph
     $graph->setFontProperties(fontName, 9);
     $graph->drawLegend(50, 220, $dataSet->GetDataDescription(), 254, 254, 254);
     $graph->setFontProperties(fontName, 8);
     $graph->drawTitle(15, 30, $title, 50, 80, 50);
     $url = $this->getUniqueMediaFileName($localGraphId, "png");
     $graph->Render(ROOT_PATH . $url);
     return ROOT_URL . $url;
 }
开发者ID:nagyist,项目名称:extension-tao-outcomeui,代码行数:61,代码来源:ReportService.php

示例10: build

 public function build()
 {
     require_once PCHART_BASE_DIR . DIRECTORY_SEPARATOR . 'pData.php';
     require_once PCHART_BASE_DIR . DIRECTORY_SEPARATOR . 'pChart.php';
     $dataSet = new pData();
     foreach ($this->lines as $name => $ordinateValues) {
         if (count($ordinateValues) != count($this->absciseValues)) {
             throw new Exception('Count of line "' . $name . '" ordinate points "' . count($ordinateValues) . '" mismatch to abscise points "' . count($this->absciseValues) . '"');
         }
         $dataSet->AddPoint($ordinateValues, $name);
     }
     $dataSet->AddPoint($this->absciseValues, 'Abscise');
     $dataSet->AddAllSeries();
     $dataSet->RemoveSerie('Abscise');
     $dataSet->SetAbsciseLabelSerie('Abscise');
     foreach ($this->lines as $name => $ordinateValues) {
         $dataSet->SetSerieName($name, $name);
     }
     $dataSet->SetYAxisUnit($this->ordinateStepTitle);
     $dataSet->SetXAxisUnit($this->absciseStepTitle);
     $chart = new pChart($this->maxWidth, $this->maxHeight);
     $chart->drawGraphAreaGradient(132, 153, 172, 50, TARGET_BACKGROUND);
     // Graph area setup
     $chart->setFontProperties(PCHART_FONTS_DIR . DIRECTORY_SEPARATOR . 'tahoma.ttf', 10);
     $chart->setGraphArea($this->graphMargins[0], $this->graphMargins[1], $this->maxWidth - $this->graphMargins[2], $this->maxHeight - $this->graphMargins[3]);
     $chart->drawGraphArea(213, 217, 221, FALSE);
     $ordinateScaleMargin = ($this->getMaxOrdinateValue() - $this->getMinOrdinateValue()) / $this->ordinateDevisions;
     $chart->setFixedScale($this->getMinOrdinateValue() - $ordinateScaleMargin, $this->getMaxOrdinateValue() + $ordinateScaleMargin, $this->ordinateDevisions);
     $chart->drawScale($dataSet->GetData(), $dataSet->GetDataDescription(), SCALE_NORMAL, 213, 217, 221, TRUE, 0, 2);
     $chart->drawGraphAreaGradient(162, 183, 202, 50);
     $chart->drawGrid(4, TRUE, 230, 230, 230, 20);
     // Draw the line chart
     //		$chart->setShadowProperties(1, 1, 0, 0, 0, 30, 4);
     $chart->drawLineGraph($dataSet->GetData(), $dataSet->GetDataDescription());
     $chart->clearShadow();
     $chart->drawPlotGraph($dataSet->GetData(), $dataSet->GetDataDescription(), 5, 3, -1, -1, -1, TRUE);
     // Draw the legend
     $chart->drawLegend($this->maxWidth - $this->graphMargins[2] + 10, $this->graphMargins[1], $dataSet->GetDataDescription(), 236, 238, 240, 52, 58, 82);
     // Draw chart title
     if ($this->chartTitle) {
         $chart->drawTextBox(0, $this->maxHeight - 20, $this->maxWidth, $this->maxHeight, $this->chartTitle, 0, 255, 255, 255, ALIGN_RIGHT, TRUE, 0, 0, 0, 30);
     }
     // Render the picture
     $chart->addBorder(2);
     $chart->Render($this->outputFilepath);
 }
开发者ID:ATouhou,项目名称:dbench,代码行数:46,代码来源:Chart.php

示例11: gerarGraficoLinhas

 public function gerarGraficoLinhas()
 {
     if (count($this->_dados[0]) < 1) {
         die("Algum dado deve ser passado. <br>Ex. \$grafico->setDados(array(10,20,30));");
     }
     if (count($this->_dados[0]) != count($this->_tituloItens)) {
         die("A quantidade de titulos passados difere da quantidade de valores. Certifique-se de que eles estejam em igual numero.");
     }
     // Montando plotagens com os arrays de dados passados
     $DataSet = new pData();
     // Definindo labels dos eixos
     if (!empty($this->_tituloEixoX)) {
         $DataSet->SetXAxisName($this->_tituloEixoX);
         $DataSet->SetYAxisName($this->_tituloEixoY);
     }
     // Montando plotagens com os arrays de dados passados
     for ($i = 0; $i < count($this->_dados); $i++) {
         $DataSet->AddPoint($this->_dados[$i], $this->_tituloDados[$i]);
         $DataSet->AddSerie($this->_tituloDados[$i]);
         //x($this->_tituloItens[$i]);
     }
     // Definindo labels dos dados
     if (count($this->_tituloItens) > 0) {
         $DataSet->AddPoint($this->_tituloItens, "labels");
         $DataSet->SetAbsciseLabelSerie("labels");
     }
     // Initialise the graph
     $Test = new pChart($this->_larguraGrafico * 2, $this->_alturaGrafico * 2);
     $Test->setFontProperties(CAMINHO_PCHART_FONT . "/tahoma.ttf", 8);
     $Test->setGraphArea($this->_margem * 3, $this->_margem * 2, 120 * $this->_larguraGrafico / 100, 130 * $this->_alturaGrafico / 100 - 10);
     $Test->drawFilledRoundedRectangle(7, 7, 150 * $this->_larguraGrafico / 100, 150 * $this->_alturaGrafico / 100, 5, $this->_corFundo["r"], $this->_corFundo["g"], $this->_corFundo["b"]);
     $Test->drawRoundedRectangle(5, 5, 150 * $this->_larguraGrafico / 100 + 3, 150 * $this->_alturaGrafico / 100 + 3, 5, $this->_corMargem["r"], $this->_corMargem["g"], $this->_corMargem["b"]);
     $Test->drawGraphArea(255, 255, 255, TRUE);
     $Test->drawScale($DataSet->GetData(), $DataSet->GetDataDescription(), SCALE_START0, $this->_corLabels["r"], $this->_corLabels["g"], $this->_corLabels["b"], TRUE, $this->_anguloValores, 0, TRUE);
     $Test->drawGrid(4, TRUE);
     // Draw the 0 line
     $Test->setFontProperties(CAMINHO_PCHART_FONT . "/tahoma.ttf", 10);
     $Test->drawTreshold(0, 143, 55, 72, TRUE, TRUE);
     if ($this->_qtdeSeries <= 1 && $this->_exibirValores == true) {
         $Test->writeValues($DataSet->GetData(), $DataSet->GetDataDescription(), $this->_tituloDados);
     }
     // Draw the limit graph
     $Test->drawLineGraph($DataSet->GetData(), $DataSet->GetDataDescription());
     // Finish the graph
     $Test->setFontProperties(CAMINHO_PCHART_FONT . "/tahoma.ttf", 8);
     $Test->drawLegend(72 * $this->_larguraGrafico / 100, 50, $DataSet->GetDataDescription(), 255, 249, 223, 15, 15, 15);
     $Test->setFontProperties(CAMINHO_PCHART_FONT . "/tahoma.ttf", 14);
     $Test->drawTitle($this->_larguraGrafico / 2 - 20, 30, $this->_tituloGrafico, $this->_corLabels["r"], $this->_corLabels["g"], $this->_corLabels["b"]);
     $Test->Stroke();
 }
开发者ID:hackultura,项目名称:novosalic,代码行数:50,代码来源:Grafico.php

示例12: pChart

 /**
  * Рисуем графики с помощью библиотеки pChart
  * @param object $model
  * @param integer $max_id
  * @param integer $x
  * @param integer $y
  * @param integer $y2
  */
 public function pChart($model, $max_id, $x, $y, $y2 = NULL)
 {
     /* Include the pData class */
     require_once Yii::getAlias('@app') . '/pChart/pChart/pData.class';
     require_once Yii::getAlias('@app') . '/pChart/pChart/pCache.class';
     require_once Yii::getAlias('@app') . '/pChart/pChart/pChart.class';
     //создаем объект данных
     $myData = new \pData();
     if (!$y2) {
         $datas = $model::find()->select([$x, $y])->andWhere("id > {$max_id} - 7")->all();
     } else {
         $datas = $model::find()->select([$x, $y, $y2])->andWhere("id > {$max_id} - 7")->all();
     }
     foreach ($datas as $key => $data) {
         $myData->AddPoint($data->{$x}, $x);
         $myData->AddPoint($data->{$y}, $y);
         if ($y2 != NULL) {
             $myData->AddPoint($data->{$y2}, $y2);
         }
     }
     //устанавливаем точки с датами
     //на ось абсцисс
     $myData->SetAbsciseLabelSerie($x);
     //помечаем данные как предназначеные для
     //отображения
     $myData->AddSerie($y);
     $myData->AddSerie($y2);
     //устанавливаем имена
     $myData->SetSerieName($y);
     $myData->SetSerieName($y2);
     //создаем график шириной  и высотой  px
     $graph = new \pChart(340, 130);
     //устанавливаем шрифт и размер шрифта
     $graph->setFontProperties(Yii::getAlias('@app') . '/pChart/Fonts/tahoma.ttf', true, 8);
     //координаты левой верхней вершины и правой нижней
     //вершины графика
     $graph->setGraphArea(35, 20, 330, 110);
     //добавляем бэкграунд
     $graph->drawBackground(255, 0, 0);
     $graph->drawGraphAreaGradient(132, 153, 172, 50, TARGET_BACKGROUND);
     //рисуем заполненный четырехугольник
     $graph->drawFilledRoundedRectangle(7, 7, 993, 493, 5, 240, 240, 240);
     //теперь незаполненный для эффекта тени
     $graph->drawRoundedRectangle(5, 5, 995, 495, 5, 0, 200, 0);
     //прорисовываем фон графика
     $graph->drawGraphArea(200, 255, 255, TRUE);
     //устанавливаем данные для графиков
     $graph->drawScale($myData->GetData(), $myData->GetDataDescription(), SCALE_NORMAL, 10, 10, 10, true, 0, 2);
     //рисуем сетку для графика
     $graph->drawGrid(4, TRUE, 200, 230, 230, 50);
     //прорисовываем линейные графики
     $graph->drawLineGraph($myData->GetData(), $myData->GetDataDescription());
     // рисуем точки на графике
     $graph->drawPlotGraph($myData->GetData(), $myData->GetDataDescription(), 3, 2, 255, 255, 255);
     // пишем в подвале некоторый текст
     $graph->setFontProperties(Url::to('@app/pChart/Fonts/tahoma.ttf', true), 8);
     $graph->drawTextBox(805, 470, 990, 480, "{$x}", 0, 150, 150, 150, ALIGN_CENTER, TRUE, -1, -1, -1, 30);
     $graph->drawTextBox(10, 470, 140, 480, "{$y}", 0, 250, 250, 250, ALIGN_CENTER, TRUE, -1, -1, -1, 30);
     //ложим легенду
     $graph->drawLegend(90, 35, $myData->GetDataDescription(), 255, 255, 255);
     //Пишем заголовок
     $graph->setFontProperties(Url::to('@app/pChart/Fonts/tahoma.ttf', true), 8);
     $graph->drawTitle(480, 22, "График", 50, 50, 50, -1, -1, true);
     //выводим в браузер
     $graph->Render(Url::to('@app/web/uploads/' . $y . '.png'));
 }
开发者ID:roman1970,项目名称:lis,代码行数:74,代码来源:DefaultController.php

示例13: drawLine

 /**
  * Draw line style chart
  * @return unknown
  */
 protected function drawLine()
 {
     // prepare font & series
     $this->_prepareSerie();
     $this->_prepareFont();
     // init chart params
     $outer_w = $this->w - 5;
     // Outer frame witdh
     $outer_h = $this->h - 5;
     // Outer frame heigth
     $inner_w = $this->w - 7;
     // Inner frame witdh
     $inner_h = $this->h - 7;
     // Inner frame heigth
     $chart_w = $this->w - 150;
     // Chart frame witdh
     $chart_h = $this->h - 40;
     // Chart frame heigth
     $title_w = $this->w - 200;
     // Title width
     $title_h = 45;
     // Title height
     $legend_w = $chart_w + 30;
     // Legend width
     $legend_h = 40;
     // Legend height
     // chart styles
     $grid = isset($this->p['grid']) ? $this->p['grid'] : false;
     $plot = isset($this->p['plot']) ? $this->p['plot'] : false;
     $curve = isset($this->p['curve']) ? $this->p['curve'] : false;
     $filled = isset($this->p['filled']) ? $this->p['filled'] : false;
     // fill chart
     $this->chart->drawBackground(255, 255, 255);
     $this->chart->setFontProperties($this->font, 7);
     // set font and size
     $this->chart->drawRoundedRectangle(5, 5, $outer_w, $outer_h, 10, 230, 230, 230);
     // drawRoundedRectangle($X1,$Y1,$X2,$Y2,$Radius,$R,$G,$B)
     $this->chart->drawFilledRoundedRectangle(7, 7, $inner_w, $inner_h, 10, 240, 240, 240);
     // drawRoundedRectangle($X1,$Y1,$X2,$Y2,$Radius,$R,$G,$B)
     $this->chart->setGraphArea(70, 40, $chart_w, $chart_h);
     // setGraphArea($X1,$Y1,$X2,$Y2)
     $this->chart->drawGraphArea(255, 255, 255, TRUE);
     // drawGraphArea($R,$G,$B)
     $this->chart->drawScale($this->data->GetData(), $this->data->GetDataDescription(), SCALE_NORMAL, 150, 150, 150, TRUE, 0, 2, $this->margin, $this->skip);
     // drawScale($Data,$DataDescription,$ScaleMode,$R,$G,$B,$DrawTicks=TRUE,$Angle=0,$Decimals=1,$WithMargin=FALSE,$SkipLabels=1,$RightScale=FALSE)
     $this->data->RemoveSerie('DEFAULT_SCALE');
     // clear scale serie for setScale method
     // draw grid
     if ($grid) {
         $this->chart->drawGrid(3, TRUE, 230, 230, 230, 50);
         // drawGrid($LineWidth,$Mosaic=TRUE,$R=220,$G=220,$B=220,$Alpha=255)
     }
     // draw the 0 line
     //$this->chart->setFontProperties($this->font,6);
     //$this->chart->drawTreshold(0,143,55,72,TRUE,TRUE);
     // draw the cubic curve graph
     if ($curve) {
         $this->chart->drawCubicCurve($this->data->GetData(), $this->data->GetDataDescription());
         if ($filled) {
             $this->chart->drawFilledCubicCurve($this->data->GetData(), $this->data->GetDataDescription(), 0.1, 50);
             // filled cubic curve graph
         }
         // draw the line graph
     } else {
         $this->chart->drawLineGraph($this->data->GetData(), $this->data->GetDataDescription());
         if ($filled) {
             $this->chart->drawFilledLineGraph($this->data->GetData(), $this->data->GetDataDescription(), 50);
         }
     }
     // plot style point
     if ($plot) {
         $this->chart->drawPlotGraph($this->data->GetData(), $this->data->GetDataDescription(), 3, 2, 255, 255, 255, true);
         // drawPlotGraph(&$Data,&$DataDescription,$BigRadius=5,$SmallRadius=2,$R2=-1,$G2=-1,$B2=-1,$Shadow=FALSE)
     }
     // add Title
     $this->chart->setFontProperties($this->font, 10);
     $this->chart->drawTitle(40, 0, $this->title, 50, 50, 50, $title_w, $title_h);
     // drawTitle($XPos,$YPos,$Value,$R,$G,$B,$XPos2=-1,$YPos2=-1,$Shadow=FALSE)
     // add Legend
     $this->chart->setFontProperties($this->font, 8);
     $this->chart->drawLegend($legend_w, $legend_h, $this->data->GetDataDescription(), 255, 255, 255);
     // drawLegend($description,$R,$G,$B)
 }
开发者ID:LWFeng,项目名称:hush,代码行数:87,代码来源:Chart.php

示例14: pData

//  Dataset definition
$DataSet = new pData();
$DataSet->AddPoint(array($data1, $data2, $data3, $data4, $data5), "Serie1");
$DataSet->AddPoint(array("January", "February", "March", "April", "May", "June"), "Serie2");
$DataSet->AddAllSeries();
$DataSet->SetAbsciseLabelSerie("Serie2");
// Initialise the graph
$Test = new pChart(700, 230);
$Test->setFontProperties("Fonts/tahoma.ttf", 8);
$Test->setGraphArea(60, 30, 680, 200);
$Test->drawFilledRoundedRectangle(7, 7, 693, 223, 5, 240, 240, 240);
$Test->drawRoundedRectangle(5, 5, 695, 225, 5, 230, 230, 230);
$Test->drawGraphArea(255, 255, 255, TRUE);
$Test->drawScale($DataSet->GetData(), $DataSet->GetDataDescription(), 5, 150, 150, 150, TRUE, 0, 2);
$Test->drawGrid(4, TRUE, 230, 230, 230, 50);
// Draw the 0 line
$Test->setFontProperties("Fonts/tahoma.ttf", 6);
$Test->drawTreshold(0, 143, 55, 72, TRUE, TRUE);
// Draw the area
$Test->drawArea($DataSet->GetData(), "Serie1", "Serie3", 239, 238, 227, 50);
// Draw the line graph
$DataSet->RemoveSerie("Serie1");
$DataSet->RemoveSerie("Serie3");
$Test->drawLineGraph($DataSet->AddPoint(array($data1, $data2, $data3, $data4, $data5), "Serie1"), $DataSet->GetDataDescription(), 0.1);
$Test->drawPlotGraph($DataSet->AddPoint(array($data1, $data2, $data3, $data4, $data5), "Serie1"), $DataSet->GetDataDescription(), 0, 2, 3, 24, 30);
// Finish the graph
$Test->setFontProperties("Fonts/tahoma.ttf", 8);
$Test->drawLegend(65, 35, $DataSet->GetDataDescription(), 250, 250, 250);
$Test->setFontProperties("Fonts/tahoma.ttf", 10);
$Test->drawTitle(60, 22, "Reporting Rate", 50, 50, 50, 585);
$Test->Render("example45.png");
开发者ID:OmondiKevin,项目名称:CD4,代码行数:31,代码来源:Example4.php

示例15: generateGraphImage

 protected function generateGraphImage($finalData, $hourflag, $title = 'Sticky Charts', $x_axis_format = 'date')
 {
     $path = $this->config->item('csv_upload_path');
     if (!empty($finalData['data'])) {
         $DataSet = new pData();
         $in = 0;
         foreach ($finalData['data'] as $seriesData) {
             $in++;
             $seriesIndex = 'Serie' . $in;
             $DataSet->AddPoint($seriesData['data'], $seriesIndex);
             $DataSet->SetSerieName($seriesData['name'], $seriesIndex);
             $DataSet->AddSerie($seriesIndex);
         }
         $xAxisArray = array();
         $in++;
         $seriesIndex = 'Serie' . $in;
         $catCount = count($finalData['cat']);
         if ($catCount <= 10) {
             $DataSet->SetXAxisFormat($x_axis_format);
         }
         foreach ($finalData['cat'] as $catD) {
             if ($catCount > 10) {
                 $xAxisArray[] = '';
             } else {
                 $xAxisArray[] = strtotime($catD);
             }
         }
         $DataSet->SetYAxisFormat("number");
         $DataSet->AddPoint($xAxisArray, $seriesIndex);
         $DataSet->SetAbsciseLabelSerie($seriesIndex);
         $DataSet->SetYAxisName($finalData['y_title']);
         $DataSet->SetXAxisName($finalData['x_title']);
         // Initialise the graph
         $Test = new pChart(985, 458);
         $Test->drawBackground(247, 226, 180);
         $Test->setFontProperties(APPPATH . '3rdparty/pchart/Fonts/tahoma.ttf', 8);
         $Test->setGraphArea(40, 30, 950, 400);
         $Test->drawGraphArea(109, 110, 114, false);
         $Test->drawGrid(4, false, 0, 0, 0, 50);
         $Test->setFontProperties(APPPATH . '3rdparty/pchart/Fonts/tahoma.ttf', 6);
         // Draw the line graph
         if ($title == 'Violation Report') {
             //!$hourflag &&
             $sCount = count($finalData['data']);
             if ($sCount > 0) {
                 for ($m = 0; $m < $sCount; $m++) {
                     $color = Color_handler::get_next($m);
                     $rgb = $color->get_rgb();
                     $Test->setColorPalette($m, $rgb['r'], $rgb['g'], $rgb['b']);
                 }
             }
             $Test->drawScale($DataSet->GetData(), $DataSet->GetDataDescription(), SCALE_NORMAL, 0, 0, 0, TRUE, 0, 0, TRUE);
             $Test->drawBarGraph($DataSet->GetData(), $DataSet->GetDataDescription());
         } else {
             $sCount = count($finalData['data']);
             if ($sCount > 0) {
                 for ($m = 0; $m < $sCount; $m++) {
                     $color = Color_handler::get_next($m % 3);
                     $rgb = $color->get_rgb();
                     $Test->setColorPalette($m, $rgb['r'], $rgb['g'], $rgb['b']);
                 }
             }
             $Test->setLineStyle(2);
             $Test->drawScale($DataSet->GetData(), $DataSet->GetDataDescription(), SCALE_START0, 0, 0, 0, TRUE, 0, 2);
             $Test->drawLineGraph($DataSet->GetData(), $DataSet->GetDataDescription());
             $Test->drawPlotGraph($DataSet->GetData(), $DataSet->GetDataDescription(), 2);
         }
         // Finish the graph
         $Test->setFontProperties(APPPATH . '3rdparty/pchart/Fonts/tahoma.ttf', 8);
         $Test->setFontProperties(APPPATH . '3rdparty/pchart/Fonts/tahoma.ttf', 10);
         $imgName = uniqid('graph_') . '.png';
         $Test->Render($path . $imgName);
         return upload_to_amazon_graphImage($imgName, $path);
     }
 }
开发者ID:kostya1017,项目名称:our,代码行数:75,代码来源:schedule_cron.php


注:本文中的pChart::drawLineGraph方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。