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


PHP pChart::drawArea方法代码示例

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


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

示例1: testDrawArea

 public function testDrawArea()
 {
     // Dataset definition
     $DataSet = new pData();
     $DataSet->addPoints(array(10, 9.4, 7.7, 5, 1.7, -1.7, -5, -7.7, -9.4, -10, -9.4, -7.7, -5, -1.8, 1.7), "Serie1");
     $DataSet->addPoints(array(0, 3.4, 6.4, 8.699999999999999, 9.800000000000001, 9.800000000000001, 8.699999999999999, 6.4, 3.4, 0, -3.4, -6.4, -8.6, -9.800000000000001, -9.9), "Serie2");
     $DataSet->addPoints(array(7.1, 9.1, 10, 9.699999999999999, 8.199999999999999, 5.7, 2.6, -0.9, -4.2, -7.1, -9.1, -10, -9.699999999999999, -8.199999999999999, -5.8), "Serie3");
     $DataSet->addPoints(array("Jan", "Jan", "Jan", "Feb", "Feb", "Feb", "Mar", "Mar", "Mar", "Apr", "Apr", "Apr", "May", "May", "May"), "Serie4");
     $DataSet->AddAllSeries();
     $DataSet->SetAbscissaLabelSeries("Serie4");
     $DataSet->SetSeriesName("Max Average", "Serie1");
     $DataSet->SetSeriesName("Min Average", "Serie2");
     $DataSet->SetSeriesName("Temperature", "Serie3");
     $DataSet->SetYAxisName("Temperature");
     $DataSet->SetXAxisName("Month of the year");
     // Initialise the graph
     $canvas = new TestCanvas();
     $Test = new pChart(700, 230, $canvas);
     $Test->reportWarnings("GD");
     $Test->setFixedScale(-12, 12, 5);
     $Test->setFontProperties("Fonts/tahoma.ttf", 8);
     $Test->setGraphArea(65, 30, 570, 185);
     $canvas->drawFilledRoundedRectangle(new Point(7, 7), new Point(693, 223), 5, new Color(240), 1, 0, ShadowProperties::NoShadow());
     $backgroundStyle = new BackgroundStyle(new Color(255), TRUE);
     $Test->drawGraphBackground($backgroundStyle);
     $scaleStyle = new ScaleStyle(SCALE_NORMAL, new Color(150));
     $Test->drawScale($DataSet, $scaleStyle, 0, 2, TRUE, 3);
     $Test->drawGrid(new GridStyle(4, TRUE, new Color(230), 50));
     // Draw the 0 line
     $Test->setFontProperties("Fonts/tahoma.ttf", 6);
     $Test->drawTreshold(0, new Color(143, 55, 72), TRUE, TRUE);
     // Draw the area
     $DataSet->RemoveSeries("Serie4");
     $Test->drawArea($DataSet->GetData(), "Serie1", "Serie2", new Color(239, 238, 227), 50);
     $DataSet->RemoveSeries("Serie3");
     $Test->drawLineGraph($DataSet->GetData(), $DataSet->GetDataDescription());
     // Draw the line graph
     $Test->setLineStyle(1, 6);
     $DataSet->RemoveAllSeries();
     $DataSet->AddSeries("Serie3");
     $Test->drawLineGraph($DataSet->GetData(), $DataSet->GetDataDescription());
     $Test->drawPlotGraph($DataSet->GetData(), $DataSet->GetDataDescription(), 3, 2, new Color(255));
     // Write values on Serie3
     $Test->setFontProperties("Fonts/tahoma.ttf", 8);
     $Test->writeValues($DataSet->GetData(), $DataSet->GetDataDescription(), "Serie3");
     // Finish the graph
     $Test->setFontProperties("Fonts/tahoma.ttf", 8);
     $Test->drawLegend(590, 90, $DataSet->GetDataDescription(), new Color(255));
     $Test->setFontProperties("Fonts/tahoma.ttf", 10);
     $Test->drawTitle(60, 22, "example 15", new Color(50), 585);
     // Add an image
     $Test->drawFromPNG(dirname(__FILE__) . "/../Sample/logo.png", 584, 35);
     $this->assertEquals('53b34d556af518230b7556e19349bd94', md5($canvas->getActionLog()));
 }
开发者ID:rbraband,项目名称:pChart,代码行数:54,代码来源:pChartTest.php

示例2: pChart

$Test = new pChart(700, 230);
$Test->reportWarnings("GD");
$Test->setFixedScale(-12, 12, 5);
$Test->setFontProperties("../Fonts/tahoma.ttf", 8);
$Test->setGraphArea(65, 30, 570, 185);
$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, TRUE, 3);
$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
$DataSet->RemoveSerie("Serie4");
$Test->drawArea($DataSet->GetData(), "Serie1", "Serie2", 239, 238, 227, 50);
$DataSet->RemoveSerie("Serie3");
$Test->drawLineGraph($DataSet->GetData(), $DataSet->GetDataDescription());
// Draw the line graph
$Test->setLineStyle(1, 6);
$DataSet->RemoveAllSeries();
$DataSet->AddSerie("Serie3");
$Test->drawLineGraph($DataSet->GetData(), $DataSet->GetDataDescription());
$Test->drawPlotGraph($DataSet->GetData(), $DataSet->GetDataDescription(), 3, 2, 255, 255, 255);
// Write values on Serie3
$Test->setFontProperties("../Fonts/tahoma.ttf", 8);
$Test->writeValues($DataSet->GetData(), $DataSet->GetDataDescription(), "Serie3");
// Finish the graph
$Test->setFontProperties("../Fonts/tahoma.ttf", 8);
$Test->drawLegend(590, 90, $DataSet->GetDataDescription(), 255, 255, 255);
$Test->setFontProperties("../Fonts/tahoma.ttf", 10);
开发者ID:han905,项目名称:pChart-php5,代码行数:31,代码来源:Example15.php

示例3: dump

$DataSet->SetSerieSymbol("Serie3", $normal_circle);
$DataSet->SetSerieSymbolLastOne("Serie3", $last_circle);
// Initialise the graph
$Test = new pChart($width, $height);
$Test->setFontPropertiesDir("{$pChart_dir}/Fonts");
// Add an image
$Test->drawFromPNG($background, 0, 0);
$Test->reportWarnings("GD");
$Test->setFixedScale($min_y_value, $max_y_value, 5);
$Test->setFontProperties("{$pChart_dir}/Fonts/tahoma.ttf", 14);
$Test->setGraphArea($area_margin_left, 20, $width - 30, $height - 55);
$Test->drawScale($DataSet->GetData(), $DataSet->GetDataDescription(), SCALE_NORMAL, 255, 255, 255, TRUE, 0, 2, TRUE, 1);
$Test->drawGrid(4, TRUE, 233, 218, 213, 0);
//画网格
// Draw the area
$Test->drawArea($DataSet->GetData(), "Serie3", "Serie4", 239, 238, 227, 40);
$DataSet->RemoveSerie("Serie4");
// Draw the line graph
$Test->setColorPalette(0, 255, 237, 237);
$Test->setLineStyle(2, 0);
//设置虚线的宽度
$Test->drawLineGraph($DataSet->GetData(), $DataSet->GetDataDescription());
$Test->setColorPalette(0, 243, 247, 252);
$Test->drawPlotGraph($DataSet->GetData(), $DataSet->GetDataDescription(), 5, 3, 255, 255, 255);
// $Test->setFontProperties("{$pChart_dir}/Fonts/simfang.ttf",14);
$Test->writeValues($DataSet->GetData(), $DataSet->GetDataDescription(), "Serie3");
// $Test->Render("example15.png");
$Test->Stroke();
function dump($data)
{
    echo "<pre>";
开发者ID:sdgdsffdsfff,项目名称:php-test-analyze,代码行数:31,代码来源:create_yuer_weight_img.php

示例4: pData

$DataSet = new pData();
$canvas = new GDCanvas(700, 230);
$Chart = new pChart(700, 230, $canvas);
// Dataset definition
CSVImporter::ImportFromCSV($DataSet, "../sample/datawithtitle.csv", ",", array(1, 2, 3), TRUE, 0);
$DataSet->AddAllSeries();
$DataSet->setAbscissaLabelSeries();
// Initialise the graph
$Chart->setFontProperties("../Fonts/tahoma.ttf", 8);
$Chart->setGraphArea(60, 30, 680, 200);
$canvas->drawFilledRoundedRectangle(new Point(7, 7), new Point(693, 223), 5, new Color(240), 1, 0, ShadowProperties::NoShadow());
$canvas->drawRoundedRectangle(new Point(5, 5), new Point(695, 225), 5, new Color(230), 1, 0, ShadowProperties::NoShadow());
$Chart->drawGraphBackground(new BackgroundStyle(new Color(255), TRUE));
$Chart->drawScale($DataSet, ScaleStyle::DefaultStyle(), 0, 2);
$Chart->drawGrid(new GridStyle(4, TRUE, new Color(230, 230, 230), TRUE));
// Draw the 0 line
$Chart->setFontProperties("../Fonts/tahoma.ttf", 6);
$Chart->drawTreshold(0, new Color(143, 55, 72), TRUE, TRUE);
// Draw the area
$Chart->drawArea($DataSet, "Serie 1", "Serie 3", new Color(239, 238, 227));
// Draw the line graph
$Chart->drawLineGraph($DataSet->GetData(), $DataSet->GetDataDescription());
$Chart->drawPlotGraph($DataSet->GetData(), $DataSet->GetDataDescription(), 3, 2, new Color(255));
// Finish the graph
$Chart->setFontProperties("../Fonts/tahoma.ttf", 8);
$Chart->drawLegend(65, 35, $DataSet->GetDataDescription(), new Color(250));
$Chart->setFontProperties("../Fonts/tahoma.ttf", 10);
$Chart->drawTitle(60, 22, "Example 4", new Color(50), 585);
$Chart->Render("Example4.png");
header("Content-Type:image/png");
readfile("Example4.png");
开发者ID:rbraband,项目名称:pChart,代码行数:31,代码来源:Example4.php


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