/** * Get the legend of the fieldset. * * @return string */ public function getLegend() { if (!isset($this->legend)) { $this->legend = new Legend(); } return $this->legend->setContent(function () { return $this->getOption('legend'); }); }
/** * Finalize the drawing of the component */ function finalize($drawer) { // Draw component title $point = new awPoint($this->w / 2, $this->padding->top - 8); $this->title->draw($drawer, $point); // Draw legend $this->legend->draw($drawer); }
</div> <!-- <div class="row"> <?php echo $form->labelEx($model, 'CORP'); ?> <?php echo $form->textField($model, 'CORP', array('size' => 30, 'maxlength' => 30)); ?> <?php echo $form->error($model, 'CORP'); ?> </div> --> <?php echo $form->label($model, 'CORP'); $cityOptions = CHtml::listData(Legend::model()->findAll(), 'nama_legend', 'nama_legend'); echo $form->dropDownList($model, 'CORP', $cityOptions, array('prompt' => '-- Pilih Lokasi Anda --')); ?> <?php if ($update != 1) { if (extension_loaded('gd')) { ?> <div class="row"> <?php echo CHtml::activeLabelEx($model, 'verifyCode'); ?> <div> <?php $this->widget('CCaptcha');
<?php /** * Created by PhpStorm. * User: martinmatak * Date: 06/03/16 * Time: 15:36 */ 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]));
require_once '../Autoloader.php'; header('Content-Type:image/png'); $platno = new Canvas(); $podaci = new DataCollection(); //line chart $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, 100); $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);
<?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');
* This file is part of p.mapper. * * p.mapper is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. See the COPYING file. * * p.mapper is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with p.mapper; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * ******************************************************************************/ require_once "../group.php"; require_once "../pmsession.php"; require_once "../common.php"; require_once "../globals.php"; require_once "../legend.php"; if ($_SESSION['legendDynamicUpdate']) { $ge = $_SESSION['GEOEXT']; } else { $ge = null; } $leg = new Legend($map); $legHTML = $leg->writeGroups(false, $ge); header("Content-Type: text/plain; charset={$defCharset}"); echo "{$legHTML}";
public function testToArray() { $this->assertCount(0, $this->legend->toArray()); }