• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP ezcGraphLineChart类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: testSetFontForElementWithRendering

 public function testSetFontForElementWithRendering()
 {
     $chart = new ezcGraphLineChart();
     $chart->data['sampleData'] = new ezcGraphArrayDataSet(array('sample 1' => 234, 'sample 2' => 21, 'sample 3' => 324, 'sample 4' => 120, 'sample 5' => 1));
     $chart->options->font->path = $this->basePath . 'font.ttf';
     $chart->legend->font->path = $this->basePath . 'font2.ttf';
     $chart->render(500, 200);
     $this->assertEquals($this->basePath . 'font.ttf', $chart->options->font->path, 'General font face should be the old one.');
     $this->assertEquals($this->basePath . 'font.ttf', $chart->title->font->path, 'Font face for X axis should be the old one.');
     $this->assertTrue($chart->legend->font instanceof ezcGraphFontOptions, 'No fontOptions object was created.');
     $this->assertEquals($this->basePath . 'font2.ttf', $chart->legend->font->path, 'Font face for legend has not changed.');
 }
开发者ID:mediasadc,项目名称:alba,代码行数:12,代码来源:font_test.php


示例2: testRenderTextTopMargin

 public function testRenderTextTopMargin()
 {
     $chart = new ezcGraphLineChart();
     $chart->data['sample'] = new ezcGraphArrayDataSet(array('foo' => 1, 'bar' => 10));
     $chart->title = 'Title of a chart';
     $chart->title->position = ezcGraph::TOP;
     $chart->title->margin = 5;
     $mockedRenderer = $this->getMock('ezcGraphRenderer2d', array('drawText'));
     // Y-Axis
     $mockedRenderer->expects($this->at(0))->method('drawText')->with($this->equalTo(new ezcGraphBoundings(6, 6, 494, 14)), $this->equalTo('Title of a chart'), $this->equalTo(ezcGraph::CENTER | ezcGraph::MIDDLE));
     $chart->renderer = $mockedRenderer;
     $chart->render(500, 200);
 }
开发者ID:mediasadc,项目名称:alba,代码行数:13,代码来源:text_test.php


示例3: testAxisSpaceConfiguration

 /**
  * @dataProvider getAxisConfiguration
  */
 public function testAxisSpaceConfiguration(ezcGraphAxisLabelRenderer $xRenderer, ezcGraphAxisLabelRenderer $yRenderer, $xSpace, $ySpace, $outerSpace, $xAlign, $yAlign)
 {
     $filename = $this->tempDir . __FUNCTION__ . '_' . self::$i . '.svg';
     $chart = new ezcGraphLineChart();
     $chart->palette = new ezcGraphPaletteBlack();
     $chart->xAxis->axisLabelRenderer = $xRenderer;
     $chart->xAxis->axisSpace = $xSpace;
     $chart->xAxis->outerAxisSpace = $outerSpace;
     $chart->xAxis->position = $xAlign;
     $chart->yAxis->axisLabelRenderer = $yRenderer;
     $chart->yAxis->axisSpace = $ySpace;
     $chart->yAxis->outerAxisSpace = $outerSpace;
     $chart->yAxis->position = $yAlign;
     $chart->data['sampleData'] = new ezcGraphArrayDataSet(array('sample 1' => 250, 'sample 2' => 250, 'sample 3' => 0, 'sample 4' => 0, 'sample 5' => 500, 'sample 6' => 500));
     $chart->render(560, 250, $filename);
     $this->compare($filename, $this->basePath . 'compare/' . __CLASS__ . '_' . __FUNCTION__ . '_' . self::$i . '.svg');
 }
开发者ID:naderman,项目名称:ezc-graph,代码行数:20,代码来源:axis_space_test.php


示例4: ezcGraphLineChart

<?php

require_once 'tutorial_insert_data.php';
// Receive data from database
$db = ezcDbInstance::get();
$query = $db->createSelectQuery();
$query->select('hits')->from('browser_hits');
$statement = $query->prepare();
$statement->execute();
// Create chart from data
$chart = new ezcGraphLineChart();
$chart->title = 'Browser statistics';
$chart->options->fillLines = 220;
$chart->data['browsers'] = new ezcGraphDatabaseDataSet($statement);
$chart->data['average'] = new ezcGraphDataSetAveragePolynom($chart->data['browsers']);
$chart->render(400, 150, 'tutorial_single.svg');
开发者ID:andikoller,项目名称:FHC-3.0-FHBGLD,代码行数:16,代码来源:tutorial_single.php


示例5: testStrToTimeLabelConvertionRendering

 public function testStrToTimeLabelConvertionRendering()
 {
     $filename = $this->tempDir . __FUNCTION__ . '.svg';
     $chart = new ezcGraphLineChart();
     $chart->data['some data'] = new ezcGraphArrayDataSet(array('1.1.2001' => 12, '1.1.2002' => 324, '1.1.2003' => 238, '1.1.2004' => 123));
     $chart->data['some data']->symbol = ezcGraph::DIAMOND;
     $chart->render(500, 200, $filename);
     $this->compare($filename, $this->basePath . 'compare/' . __CLASS__ . '_' . __FUNCTION__ . '.svg');
 }
开发者ID:madscientist159,项目名称:Graph,代码行数:9,代码来源:date_axis_test.php


示例6: testRenderCompleteLineChart2

 public function testRenderCompleteLineChart2()
 {
     $filename = $this->tempDir . __FUNCTION__ . '.svg';
     $chart = new ezcGraphLineChart();
     date_default_timezone_set('MET');
     $chart->data['Statistical data'] = new ezcGraphArrayDataSet(array('Jun 2006' => 1300000, 'May 2006' => 1200000, 'Apr 2006' => 1100000, 'Mar 2006' => 1100000, 'Feb 2006' => 1000000, 'Jan 2006' => 965000));
     $chart->data['Statistical data']->symbol = ezcGraph::BULLET;
     $chart->data['polynom order 2'] = new ezcGraphDataSetAveragePolynom($chart->data['Statistical data'], 2);
     $chart->xAxis = new ezcGraphChartElementNumericAxis();
     try {
         $chart->render(500, 200, $filename);
     } catch (ezcGraphDatasetAverageInvalidKeysException $e) {
         return true;
     }
     $this->fail('Expected ezcGraphDatasetAverageInvalidKeysException.');
 }
开发者ID:xyzz,项目名称:CrashFix,代码行数:16,代码来源:dataset_average_test.php


示例7: testRenderCompleteLineChart

 public function testRenderCompleteLineChart()
 {
     $filename = $this->tempDir . __FUNCTION__ . '.svg';
     $chart = new ezcGraphLineChart();
     $chart->data['Sinus'] = new ezcGraphNumericDataSet(-180, 180, create_function('$x', 'return 10 * sin( deg2rad( $x ) );'));
     $chart->data['Cosinus'] = new ezcGraphNumericDataSet(-180, 180, create_function('$x', 'return 5 * cos( deg2rad( $x ) );'));
     $chart->xAxis = new ezcGraphChartElementNumericAxis();
     $chart->render(500, 200, $filename);
     $this->compare($filename, $this->basePath . 'compare/' . __CLASS__ . '_' . __FUNCTION__ . '.svg');
 }
开发者ID:mediasadc,项目名称:alba,代码行数:10,代码来源:dataset_numeric_test.php


示例8: graph_bydate

function graph_bydate($p_metrics, $p_labels, $p_title, $p_graph_width = 300, $p_graph_height = 380)
{
    $t_graph_font = graph_get_font();
    error_check(is_array($p_metrics) ? count($p_metrics) : 0, lang_get('by_date'));
    if (plugin_config_get('eczlibrary') == ON) {
        $t_metrics = array();
        $t_dates = array_shift($p_metrics);
        //[0];
        $t_cnt = count($p_metrics);
        foreach ($t_dates as $i => $val) {
            //$t_metrics[$val]
            for ($j = 0; $j < $t_cnt; $j++) {
                $t_metrics[$j][$val] = $p_metrics[$j][$i];
            }
        }
        $graph = new ezcGraphLineChart();
        $graph->background->color = '#FFFFFF';
        $graph->xAxis = new ezcGraphChartElementNumericAxis();
        for ($k = 0; $k < $t_cnt; $k++) {
            $graph->data[$k] = new ezcGraphArrayDataSet($t_metrics[$k]);
            $graph->data[$k]->label = $p_labels[$k + 1];
        }
        $graph->xAxis->labelCallback = 'graph_date_format';
        $graph->xAxis->axisLabelRenderer = new ezcGraphAxisRotatedLabelRenderer();
        $graph->xAxis->axisLabelRenderer->angle = -45;
        $graph->legend->position = ezcGraph::BOTTOM;
        $graph->legend->background = '#FFFFFF80';
        $graph->driver = new ezcGraphGdDriver();
        //$graph->driver->options->supersampling = 1;
        $graph->driver->options->jpegQuality = 100;
        $graph->driver->options->imageFormat = IMG_JPEG;
        $graph->title = $p_title . ' ' . lang_get('by_date');
        $graph->options->font = $t_graph_font;
        $graph->renderToOutput($p_graph_width, $p_graph_height);
    } else {
        $graph = new Graph($p_graph_width, $p_graph_height);
        $graph->img->SetMargin(40, 140, 40, 100);
        if (ON == plugin_config_get('jpgraph_antialias')) {
            $graph->img->SetAntiAliasing();
        }
        $graph->SetScale('linlin');
        $graph->SetMarginColor('white');
        $graph->SetFrame(false);
        $graph->title->Set($p_title . ' ' . lang_get('by_date'));
        $graph->title->SetFont($t_graph_font, FS_BOLD);
        $graph->legend->Pos(0.01, 0.05, 'right', 'top');
        $graph->legend->SetShadow(false);
        $graph->legend->SetFillColor('white');
        $graph->legend->SetLayout(LEGEND_VERT);
        $graph->legend->SetFont($t_graph_font);
        $graph->yaxis->scale->ticks->SetDirection(-1);
        $graph->yaxis->SetFont($t_graph_font);
        $graph->yaxis->scale->SetAutoMin(0);
        if (FF_FONT2 <= $t_graph_font) {
            $graph->xaxis->SetLabelAngle(60);
        } else {
            $graph->xaxis->SetLabelAngle(90);
            # can't rotate non truetype fonts
        }
        $graph->xaxis->SetLabelFormatCallback('graph_date_format');
        $graph->xaxis->SetFont($t_graph_font);
        /*		$t_line_colours = plugin_config_get( 'jpgraph_colors' );
        		$t_count_colours = count( $t_line_colours );*/
        $t_lines = count($p_metrics) - 1;
        $t_line = array();
        for ($i = 1; $i <= $t_lines; $i++) {
            $t_line[$i] = new LinePlot($p_metrics[$i], $p_metrics[0]);
            //$t_line[$i]->SetColor( $t_line_colours[$i % $t_count_colours] );
            $t_line[$i]->SetCenter();
            $t_line[$i]->SetLegend($p_labels[$i]);
            $graph->Add($t_line[$i]);
        }
        if (helper_show_query_count()) {
            $graph->subtitle->Set(db_count_queries() . ' queries (' . db_time_queries() . 'sec)');
            $graph->subtitle->SetFont($t_graph_font, FS_NORMAL, 8);
        }
        $graph->Stroke();
    }
}
开发者ID:kaos,项目名称:mantisbt,代码行数:79,代码来源:graph_api.php


示例9: testRotatedAxisLabel

 public function testRotatedAxisLabel()
 {
     $filename = $this->tempDir . __FUNCTION__ . '.svg';
     $graph = new ezcGraphLineChart();
     $graph->palette = new ezcGraphPaletteBlack();
     $graph->data['sample1'] = new ezcGraphArrayDataSet(array(1, 4, 6, 8, 2));
     $graph->data['sample1']->symbol = ezcGraph::SQUARE;
     $graph->data['sample2'] = new ezcGraphArrayDataSet(array(4, 6, 8, 2, 1));
     $graph->data['sample2']->symbol = ezcGraph::BOX;
     $graph->xAxis->label = "Some axis label";
     $graph->xAxis->labelRotation = 90;
     $graph->render(560, 250, $filename);
     $this->compare($filename, $this->basePath . 'compare/' . __CLASS__ . '_' . __FUNCTION__ . '.svg');
 }
开发者ID:xyzz,项目名称:CrashFix,代码行数:14,代码来源:renderer_2d_test.php


示例10: testReRenderChart

 public function testReRenderChart()
 {
     $filename = $this->tempDir . __FUNCTION__ . '.svg';
     $barChart = new ezcGraphLineChart();
     $barChart->data['test'] = new ezcGraphArrayDataSet(array(5, 23, 42));
     $color = $barChart->data['test']->color->default;
     $barChart->render(400, 200, $filename);
     $this->compare($filename, $this->basePath . 'compare/' . __CLASS__ . '_' . __FUNCTION__ . '.svg');
     // Render a second time with a new dataset, and expect the same result
     $barChart->data['test'] = new ezcGraphArrayDataSet(array(5, 23, 42));
     $barChart->data['test']->color = $color;
     $barChart->render(400, 200, $filename);
     $this->compare($filename, $this->basePath . 'compare/' . __CLASS__ . '_' . __FUNCTION__ . '.svg');
 }
开发者ID:xyzz,项目名称:CrashFix,代码行数:14,代码来源:chart_test.php


示例11: testRenderWithZeroAxisSpace

 public function testRenderWithZeroAxisSpace()
 {
     $filename = $this->tempDir . __FUNCTION__ . '.svg';
     $labelCount = 20;
     $data = $this->getRandomData($labelCount, 500, 2000, 23);
     $chart = new ezcGraphLineChart();
     $chart->palette = new ezcGraphPaletteBlack();
     $chart->data['sample'] = new ezcGraphArrayDataSet($data);
     // Set manual label count
     $chart->xAxis->labelCount = 21;
     $chart->xAxis->axisLabelRenderer = new ezcGraphAxisRotatedLabelRenderer();
     $chart->xAxis->axisLabelRenderer->angle = 45;
     $chart->xAxis->axisSpace = 0.1;
     $chart->yAxis->axisLabelRenderer = new ezcGraphAxisNoLabelRenderer();
     $chart->yAxis->axisSpace = 0;
     $chart->render(500, 200, $filename);
     $this->compare($filename, $this->basePath . 'compare/' . __CLASS__ . '_' . __FUNCTION__ . '.svg');
 }
开发者ID:naderman,项目名称:ezc-graph,代码行数:18,代码来源:axis_rotated_renderer_test.php


示例12: testShortAxis

 public function testShortAxis()
 {
     $filename = $this->tempDir . __FUNCTION__ . '.svg';
     $graph = new ezcGraphLineChart();
     $graph->palette = new ezcGraphPaletteBlack();
     $graph->legend->position = ezcGraph::BOTTOM;
     $graph->data['sample'] = new ezcGraphArrayDataSet(array(1, 4, 6, 8, 2));
     $graph->renderer = new ezcGraphRenderer3d();
     $graph->renderer->options->axisEndStyle = ezcGraph::NO_SYMBOL;
     $graph->renderer->options->shortAxis = true;
     $graph->render(560, 250, $filename);
     $this->compare($filename, $this->basePath . 'compare/' . __CLASS__ . '_' . __FUNCTION__ . '.svg');
 }
开发者ID:xyzz,项目名称:CrashFix,代码行数:13,代码来源:renderer_3d_test.php


示例13: header

<?php

require 'ezc-setup.php';
header('Content-Type: image/svg+xml');
list($domains, $ips) = (require 'data-graph1.php');
$chart = new ezcGraphLineChart();
$chart->title = 'PHP Usage Statistics';
$chart->palette = new ezcGraphPaletteTango();
$chart->options->fillLines = 230;
$chart->legend->title = "Legend";
$chart->xAxis->font->maxFontSize = 12;
$chart->yAxis->font->maxFontSize = 12;
$chart->title->font->maxFontSize = 20;
$chart->data['domains'] = new ezcGraphArrayDataSet($domains);
$chart->data['domains']->label = 'Domains';
$chart->data['ips'] = new ezcGraphArrayDataSet($ips);
$chart->data['ips']->label = 'IP addresses';
$chart->driver = new ezcGraphSvgDriver();
$chart->render(600, 400, 'php://output');
开发者ID:SandyS1,项目名称:presentations,代码行数:19,代码来源:graph1.php


示例14: ezcGraphLineChart

<?php

require_once 'tutorial_autoload.php';
$wikidata = (include 'tutorial_wikipedia_data.php');
$graph = new ezcGraphLineChart();
$graph->title = 'Wikipedia articles';
// Add data
foreach ($wikidata as $language => $data) {
    $graph->data[$language] = new ezcGraphArrayDataSet($data);
}
$graph->yAxis->min = 0;
// Use a different axis for the norwegian dataset
$graph->additionalAxis['norwegian'] = $nAxis = new ezcGraphChartElementNumericAxis();
$nAxis->position = ezcGraph::BOTTOM;
$nAxis->chartPosition = 1;
$nAxis->min = 0;
$graph->data['Norwegian']->yAxis = $nAxis;
// Still use the marker
$graph->additionalAxis['border'] = $marker = new ezcGraphChartElementNumericAxis();
$marker->position = ezcGraph::LEFT;
$marker->chartPosition = 1 / 3;
$graph->render(400, 150, 'tutorial_line_chart_additional_axis.svg');
开发者ID:madscientist159,项目名称:Graph,代码行数:22,代码来源:tutorial_line_chart_additional_axis.php


示例15: testRenderTextBoxesFromBottom

 public function testRenderTextBoxesFromBottom()
 {
     $chart = new ezcGraphLineChart();
     $chart->palette = new ezcGraphPaletteBlack();
     $chart->xAxis->axisLabelRenderer = new ezcGraphAxisNoLabelRenderer();
     $chart->yAxis->axisLabelRenderer = new ezcGraphAxisBoxedLabelRenderer();
     $chart->yAxis->position = ezcGraph::BOTTOM;
     $chart->data['sampleData'] = new ezcGraphArrayDataSet(array('sample 1' => 234, 'sample 2' => 21, 'sample 3' => 324, 'sample 4' => 120, 'sample 5' => 1));
     $mockedRenderer = $this->getMock('ezcGraphRenderer2d', array('drawText'));
     $mockedRenderer->expects($this->at(0))->method('drawText')->with($this->equalTo(new ezcGraphBoundings(102.0, 150.0, 138.0, 178.0), 1.0), $this->equalTo('0'), $this->equalTo(ezcGraph::MIDDLE | ezcGraph::RIGHT));
     $mockedRenderer->expects($this->at(4))->method('drawText')->with($this->equalTo(new ezcGraphBoundings(102.0, 22.0, 138.0, 50.0), 1.0), $this->equalTo('400'), $this->equalTo(ezcGraph::MIDDLE | ezcGraph::RIGHT));
     $chart->renderer = $mockedRenderer;
     $chart->render(500, 200);
 }
开发者ID:naderman,项目名称:ezc-graph,代码行数:14,代码来源:axis_boxed_renderer_test.php


示例16: testRenderNoLabelRendererZeroAxisSpace

 public function testRenderNoLabelRendererZeroAxisSpace()
 {
     $filename = $this->tempDir . __FUNCTION__ . '.svg';
     $chart = new ezcGraphLineChart();
     $chart->additionalAxis['marker'] = $marker = new ezcGraphChartElementLabeledAxis();
     $chart->additionalAxis['empty'] = $empty = new ezcGraphChartElementLabeledAxis();
     $chart->xAxis->axisLabelRenderer = new ezcGraphAxisNoLabelRenderer();
     $chart->xAxis->axisSpace = 0;
     $chart->yAxis->axisLabelRenderer = new ezcGraphAxisNoLabelRenderer();
     $chart->yAxis->axisSpace = 0;
     $marker->position = ezcGraph::LEFT;
     $marker->axisSpace = 0;
     $marker->chartPosition = 1;
     $empty->position = ezcGraph::RIGHT;
     $empty->chartPosition = 0.0;
     $empty->axisSpace = 0;
     $empty->label = 'Marker';
     $chart->data['moreData'] = new ezcGraphArrayDataSet(array('sample 1' => 112, 'sample 2' => 54, 'sample 3' => 12, 'sample 4' => -167, 'sample 5' => 329));
     $chart->data['Even more data'] = new ezcGraphArrayDataSet(array('sample 1' => 300, 'sample 2' => -30, 'sample 3' => 220, 'sample 4' => 67, 'sample 5' => 450));
     $chart->render(500, 200, $filename);
     $this->compare($filename, $this->basePath . 'compare/' . __CLASS__ . '_' . __FUNCTION__ . '.svg');
 }
开发者ID:naderman,项目名称:ezc-graph,代码行数:22,代码来源:multiple_axis_test.php


示例17: testSvgLinkingWithWrongDriver

 public function testSvgLinkingWithWrongDriver()
 {
     $filename = $this->tempDir . __FUNCTION__ . '.svg';
     $chart = new ezcGraphLineChart();
     $chart->data['Line 1'] = new ezcGraphArrayDataSet(array('sample 1' => 234, 'sample 2' => 21, 'sample 3' => 324, 'sample 4' => 120, 'sample 5' => 1));
     $chart->render(500, 200, $filename);
     $chart->driver = new ezcGraphGdDriver();
     $chart->options->font->path = $this->basePath . 'font.ttf';
     try {
         ezcGraphTools::linkSvgElements($chart);
     } catch (ezcGraphToolsIncompatibleDriverException $e) {
         return true;
     }
     $this->fail('Expected ezcGraphToolsIncompatibleDriverException.');
 }
开发者ID:madscientist159,项目名称:Graph,代码行数:15,代码来源:tools_test.php


示例18: generateUploadStatisticsGraph

 /**
  * Generates a crash report upload statistics graph for currently 
  * selected project and dumps it to stdout.
  * @param integer $w Desired image width.
  * @param integer $h Desired image height.
  * @param integer $period Desired time period (7, 30 or 365).
  * @throws CHttpException
  * @return void
  */
 public static function generateUploadStatisticsGraph($w, $h, $period, $file = null)
 {
     if (!is_numeric($w) || $w <= 0 || $w > 1024) {
         throw new CHttpException(403, 'Invalid parameter');
     }
     if (!is_numeric($h) || $h <= 0 || $h > 960) {
         throw new CHttpException(403, 'Invalid parameter');
     }
     if (!is_numeric($period) || $period <= 0 || $period > 365) {
         throw new CHttpException(403, 'Invalid parameter');
     }
     // Get current project info
     $curProjectId = Yii::app()->user->getCurProjectId();
     $curVer = Project::PROJ_VER_NOT_SET;
     $versions = Yii::app()->user->getCurProjectVersions($curVer);
     // Prepare data
     $data = array();
     $tomorrow = mktime(0, 0, 0, date("m"), date("d") + 1, date("Y"));
     $finishDate = $tomorrow - 1;
     $curDate = $finishDate;
     $dateFrom = $curDate;
     while ($finishDate - $curDate < $period * 24 * 60 * 60) {
         // Calc the beginning of time interval
         if ($period > 30) {
             $dateFrom = mktime(0, 0, 0, date("m", $curDate) - 1, date("d", $curDate), date("Y", $curDate));
         } else {
             if ($period > 7) {
                 $dateFrom = mktime(0, 0, 0, date("m", $curDate), date("d", $curDate) - 6, date("Y", $curDate));
             } else {
                 $dateFrom = mktime(0, 0, 0, date("m", $curDate), date("d", $curDate), date("Y", $curDate));
             }
         }
         // Get count of crash reports received within the period
         $criteria = new CDbCriteria();
         $criteria->compare('project_id', $curProjectId);
         if ($curVer != Project::PROJ_VER_ALL) {
             $criteria->compare('appversion_id', $curVer);
         }
         $criteria->addBetweenCondition('received', $dateFrom, $curDate);
         $count = CrashReport::model()->count($criteria);
         // Add an item to data
         $item = array($period > 30 ? date('M y', $curDate) : date('j M', $curDate) => $count);
         $data = $item + $data;
         // Next time interval
         $curDate = $dateFrom - 1;
     }
     $graph = new ezcGraphLineChart();
     $graph->palette = new ezcGraphPaletteEzBlue();
     $graph->data['Versions'] = new ezcGraphArrayDataSet($data);
     $majorStep = round(max($data));
     if ($majorStep == 0) {
         $majorStep = 1;
     }
     $graph->yAxis->majorStep = $majorStep;
     $graph->yAxis->minorStep = $graph->yAxis->majorStep / 5;
     $graph->xAxis->labelCount = 30;
     /*$graph->xAxis = new ezcGraphChartElementDateAxis();
     		$graph->xAxis->dateFormat = 'M';
     		$graph->xAxis->endDate = $finishDate;
     		$graph->xAxis->startDate = $dateFrom;
     		$graph->xAxis->interval = ezcGraphChartElementDateAxis::MONTH;*/
     //$graph->data['Versions']->highlight = true;
     $graph->options->fillLines = 210;
     $graph->legend = false;
     $graph->legend->position = ezcGraph::RIGHT;
     $graph->options->font->name = 'Tahoma';
     $graph->options->font->maxFontSize = 12;
     $graph->options->font->minFontSize = 1;
     if ($file === null) {
         $graph->renderToOutput($w, $h);
     } else {
         $graph->render($w, $h, $file);
     }
 }
开发者ID:xyzz,项目名称:CrashFix,代码行数:83,代码来源:CrashReport.php


示例19: printAxisChart

 /**
  * Creates and prints the Axis Chart
  *
  * @static
  *
  */
 static function printAxisChart($type = 'overall')
 {
     global $CFG_GLPI, $LANG;
     // Definition of Graph Labels
     $label = array('overall' => __('Overall satisfaction', 'helpdeskrating'), 'solution' => __('Satisfaction with the solution', 'helpdeskrating'), 'tech' => __('Satisfaction with the technician', 'helpdeskrating'), 'time' => __('Satisfaction with the chronological sequence', 'helpdeskrating'));
     $uid = PluginHelpdeskratingStatistic::getUserID();
     if ($uid) {
         // Get Graph Data
         $data = PluginHelpdeskratingStatistic::getTimedRatings($type);
         if (empty($data)) {
             echo "<h1>{$label[$type]}</h1>";
             echo __('no data available', 'helpdeskrating');
         } else {
             // Create Graph
             $graph = new ezcGraphLineChart();
             $graph->title = $label[$type];
             // Set Graph Data
             foreach ($data as $key => $val) {
                 $graph->data[$key] = new ezcGraphArrayDataSet($val);
             }
             // Graph Display options
             $graph->yAxis->min = 0;
             $graph->yAxis->max = 6;
             $graph->yAxis->majorStep = 1;
             $graph->xAxis = new ezcGraphChartElementNumericAxis();
             $graph->xAxis->min = 1;
             $graph->xAxis->max = 12;
             $graph->xAxis->majorStep = 1;
             // Graph Output
             $filename = $uid . '_' . mt_rand() . '.svg';
             $graph->render(800, 300, GLPI_GRAPH_DIR . '/' . $filename);
             echo "<object data='" . $CFG_GLPI['root_doc'] . "/front/graph.send.php?file={$filename}'\n                        type='image/svg+xml' width='800' height='300'>\n                        <param name='src' value='" . $CFG_GLPI['root_doc'] . "/front/graph.send.php?file={$filename}'>\n                        You need a browser capeable of SVG to display this image.\n                        </object> ";
             // */
         }
     }
 }
开发者ID:geldarr,项目名称:hack-space,代码行数:42,代码来源:statistic.class.php


示例20: testLineChartUnsyncedFonts3d

 public function testLineChartUnsyncedFonts3d()
 {
     $filename = $this->tempDir . __FUNCTION__ . '.svg';
     $chart = new ezcGraphLineChart();
     $chart->data['sample'] = new ezcGraphArrayDataSet(array('Mozilla' => 4375, 'IE' => 345, 'Opera' => 1204, 'wget' => 231, 'Safari' => 987));
     $chart->renderer = new ezcGraphRenderer3d();
     $chart->renderer->options->syncAxisFonts = false;
     $chart->driver = new ezcGraphSvgDriver();
     $chart->render(500, 200, $filename);
     $this->compare($filename, $this->basePath . 'compare/' . __CLASS__ . '_' . __FUNCTION__ . '.svg');
 }
开发者ID:broschb,项目名称:cyclebrain,代码行数:11,代码来源:line_test.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP ezcGraphPieChart类代码示例发布时间:2022-05-23
下一篇:
PHP ezcGraphException类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap