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


PHP Canvas::save方法代码示例

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


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

示例1: Canvas

namespace graph_library;

require_once '../Autoloader.php';
header('Content-Type:image/png');
$platno = new Canvas();
$pieChart = new PieChart('naslov pie charta', 300, 300);
$legend = new Legend();
$legend->addItem(new LegendItem('1. item legende'));
$legend->addItem(new LegendItem('2. item legende'));
$podatak = new DataCollection();
$podatak->addItem(new DataCollectionItem([5]));
$id_podataka = $pieChart->addData($podatak);
$pieChart->colorData(56, 80, 57, $id_podataka);
$podatak = new DataCollection();
$podatak->addItem(new DataCollectionItem([17]));
$id_podataka = $pieChart->addData($podatak);
$pieChart->colorData(16, 20, 17, $id_podataka);
$podatak = new DataCollection();
$podatak->addItem(new DataCollectionItem([35]));
$id_podataka = $pieChart->addData($podatak);
$pieChart->colorData(36, 40, 57, $id_podataka);
$podatak = new DataCollection();
$podatak->addItem(new DataCollectionItem([35]));
$id_podataka = $pieChart->addData($podatak);
$pieChart->colorData(170, 0, 0, $id_podataka);
$pieChart->setLegend($legend, 10, 100);
$platno->addChart($pieChart, 0, 0);
$slika = $platno->render();
imagepng($slika);
$platno->save('pie.png');
开发者ID:Cibale,项目名称:sofascoreEDU,代码行数:30,代码来源:test-pie.php

示例2: LineChart

$lineChart = new LineChart('Cijena dionica', 300, 300);
$lineChart->setLegend($legend, 10, 30);
$lineChart->colorData(16, 80, 57, $lineChart->addData($podaci));
$platno->addChart($lineChart, 2, 0);
// pie chart
$pieChart = new PieChart('naslov pie charta', 300, 300);
$legend = new Legend();
$legend->addItem(new LegendItem('1. item legende'));
$legend->addItem(new LegendItem('2. item legende'));
$podatak = new DataCollection();
$podatak->addItem(new DataCollectionItem([5]));
$id_podataka = $pieChart->addData($podatak);
$pieChart->colorData(56, 80, 57, $id_podataka);
$podatak = new DataCollection();
$podatak->addItem(new DataCollectionItem([17]));
$id_podataka = $pieChart->addData($podatak);
$pieChart->colorData(16, 20, 17, $id_podataka);
$podatak = new DataCollection();
$podatak->addItem(new DataCollectionItem([35]));
$id_podataka = $pieChart->addData($podatak);
$pieChart->colorData(36, 40, 57, $id_podataka);
$podatak = new DataCollection();
$podatak->addItem(new DataCollectionItem([35]));
$id_podataka = $pieChart->addData($podatak);
$pieChart->colorData(170, 0, 0, $id_podataka);
$pieChart->setLegend($legend, 10, 100);
$platno->addChart($pieChart, 305, 0);
$slika = $platno->render();
imagepng($slika);
$platno->save('LineBarAndPie.png');
开发者ID:Cibale,项目名称:sofascoreEDU,代码行数:30,代码来源:test-line-bar-pie.php

示例3: PieChart

$id_podataka = $line_chart->addData($podaci);
$line_chart->colorData(16, 80, 57, $id_podataka);
$platno->addChart($line_chart, 0, 0);
//pie chart
$line_chart = new PieChart('Naslov pie charta', 300, 300);
$pieLegend = new Legend();
$pieLegend->addItem(new LegendItem('1. item legende'));
$pieLegend->addItem(new LegendItem('2. item legende'));
$line_chart->setLegend($pieLegend, 200, 100);
$podatak = new DataCollection();
$podatak->addItem(new DataCollectionItem([5]));
$id_podataka = $line_chart->addData($podatak);
$line_chart->colorData(56, 80, 57, $id_podataka);
$podatak = new DataCollection();
$podatak->addItem(new DataCollectionItem([17]));
$id_podataka = $line_chart->addData($podatak);
$line_chart->colorData(16, 20, 17, $id_podataka);
$podatak = new DataCollection();
$podatak->addItem(new DataCollectionItem([35]));
$id_podataka = $line_chart->addData($podatak);
$line_chart->colorData(36, 40, 57, $id_podataka);
$podatak = new DataCollection();
$podatak->addItem(new DataCollectionItem([35]));
$id_podataka = $line_chart->addData($podatak);
$line_chart->colorData(170, 0, 0, $id_podataka);
$platno->addChart($line_chart, 305, 0);
//ispis
$slika = $platno->render();
imagepng($slika);
$platno->save('lineAndPie.png');
开发者ID:Cibale,项目名称:sofascoreEDU,代码行数:30,代码来源:test-line-pie.php

示例4: Canvas

<?php

/**
 * Created by PhpStorm.
 * User: martinmatak
 * Date: 06/03/16
 * Time: 18:12
 */
namespace graph_library;

require_once '../Autoloader.php';
header('Content-Type:image/png');
$platno = new Canvas();
$podaci = new DataCollection();
$barchart = new BarChart('Cijena dionica', 300, 300);
$legend = new Legend();
$legend->addItem(new LegendItem('Relativni odnos dionica zadnjih 5 godina'));
$podaci->addItems(array(new DataCollectionItem([2011, 10]), new DataCollectionItem([2012, 15]), new DataCollectionItem([2013, 8]), new DataCollectionItem([2014, 19]), new DataCollectionItem([2015, 22])));
$barchart->setLegend($legend, 10, 25);
$barchart->colorData(16, 80, 57, $barchart->addData($podaci));
$platno->addChart($barchart, 0, 0);
$lineChart = new LineChart('Cijena dionica', 300, 300);
$lineChart->setLegend($legend, 10, 30);
$lineChart->colorData(16, 80, 57, $lineChart->addData($podaci));
$platno->addChart($lineChart, 310, 0);
$slika = $platno->render();
imagepng($slika);
$platno->save('LineAndBar.png');
开发者ID:Cibale,项目名称:sofascoreEDU,代码行数:28,代码来源:test-line-bar.php

示例5: Canvas

<?php

/**
 * Created by PhpStorm.
 * User: martinmatak
 * Date: 06/03/16
 * Time: 17:50
 */
namespace graph_library;

require_once '../Autoloader.php';
header('Content-Type:image/png');
$platno = new Canvas();
$podaci = new DataCollection();
$line_chart = new BarChart('Cijena dionica', 300, 300);
$legend = new Legend();
$legend->addItem(new LegendItem('Relativni odnos dionica zadnjih 5 godina'));
$podaci->addItems(array(new DataCollectionItem([10, '2011']), new DataCollectionItem([15, '2012']), new DataCollectionItem([8, '2013']), new DataCollectionItem([19, '2014']), new DataCollectionItem([22, '2015'])));
$line_chart->setLegend($legend, 10, 25);
$id_podataka = $line_chart->addData($podaci);
$line_chart->colorData(16, 80, 57, $id_podataka);
$platno->addChart($line_chart, 0, 0);
$slika = $platno->render();
imagepng($slika);
$platno->save('bar.png');
开发者ID:Cibale,项目名称:sofascoreEDU,代码行数:25,代码来源:test-bar.php

示例6: Canvas

<?php

/**
 * Created by PhpStorm.
 * User: martinmatak
 * Date: 04/03/16
 * Time: 15:20
 */
namespace graph_library;

require_once '../Autoloader.php';
header('Content-Type:image/png');
$platno = new Canvas();
$podaci = new DataCollection();
$line_chart = new LineChart('Cijena dionica', 300, 300);
$legend = new Legend();
$legend->addItem(new LegendItem('Relativni odnos dionica zadnjih 5 godina'));
$podaci->addItems(array(new DataCollectionItem([2011, 10]), new DataCollectionItem([2012, 15]), new DataCollectionItem([2013, 8]), new DataCollectionItem([2014, 19]), new DataCollectionItem([2015, 22])));
$line_chart->setLegend($legend, 10, 30);
$id_podataka = $line_chart->addData($podaci);
$line_chart->colorData(16, 80, 57, $id_podataka);
$platno->addChart($line_chart, 0, 0);
$slika = $platno->render();
imagepng($slika);
$platno->save('line.png');
开发者ID:Cibale,项目名称:sofascoreEDU,代码行数:25,代码来源:test-line.php


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