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


PHP Chart::setTitle方法代码示例

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


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

示例1: copyChart

 public function copyChart($src)
 {
     $chart = new Chart();
     // new id
     $chart->setId($this->getUnusedRandomId());
     // but the rest remains the same
     $chart->setUser($src->getUser());
     $chart->setTitle($src->getTitle() . ' (' . __('Copy') . ')');
     $chart->setMetadata(json_encode($src->getMetadata()));
     $chart->setTheme($src->getTheme());
     $chart->setLocale($src->getLocale());
     $chart->setType($src->getType());
     $chart->setCreatedAt(time());
     $chart->setLastModifiedAt(time());
     $chart->setLastEditStep(3);
     // we need to copy the data, too
     $chart->writeData($src->loadData());
     $chart->save();
     return $chart;
 }
开发者ID:shelsonjava,项目名称:datawrapper,代码行数:20,代码来源:ChartQuery.php

示例2: array

$values = array(array(), array(), array());
$n = 10;
for ($i = 0; $i <= $n; $i += 1) {
    $v = rand($i, $i * 10);
    $values[0][] = $v;
    $values[1][] = $v - $i;
    $values[2][] = rand(100 - ($i + 10), 100 - 10 * $i);
}
$chart = new Chart('lc', 600, 300);
$chart->setGridLines(10, 10);
$chart->setLegendPosition('r');
//~ $chart->setMargin(50);
$chart->setLegendSize(150, 20);
$chart->setFill('ffffcc');
$chart->setGradientFill(45, array('cccccc', 'ffffff', 'cccccc'), Chart::CHART_AREA);
$chart->setTitle('Us versus the others.');
$chart->setTitleColor('999999')->setTitleSize(20);
$line = new ChartData($values[0]);
$line->setLegend('Us');
$chart->addData($line);
$marker = new ChartShapeMarker(ChartShapeMarker::X);
$marker->setData($line);
$marker->setColor('6699cc');
$chart->addMarker($marker);
$marker = new ChartTextMarker(ChartTextMarker::VALUE);
$marker->setData($line);
$chart->addMarker($marker);
$line = new ChartData($values[1]);
$line->setDash(2, 2);
$line->setColor('6699cc');
$chart->addData($line);
开发者ID:zoopcommerce,项目名称:mirage,代码行数:31,代码来源:line_chart_full.php

示例3: array

<?php

require '../lib/Chart.php';
$sin = array();
$cos = array();
for ($i = 0; $i <= 360; $i += 10) {
    $sin[] = round(sin($i * M_PI / 180), 2);
    $cos[] = round(cos($i * M_PI / 180), 2);
}
$chart = new Chart('lc', 500, 200);
$chart->setGridLines(25, 50, 1, 1);
$chart->setMargin(30, 50);
$chart->setLegendSize(100, 10);
$chart->setFill('333333');
$chart->setFill('444444', Chart::CHART_AREA);
$chart->setTitle('Sinus & Cosinus');
$chart->setTitleColor('FFFFFF');
$chart->setTitleSize(18);
$sin = new ChartData($sin);
$sin->setLegend('Sinus');
$sin->setThickness(2);
$sin->setColor('D1F2A5');
$chart->addData($sin);
$cos = new ChartData($cos);
$cos->setLegend('Cosinus');
$cos->setThickness(2);
$cos->setColor('F56991');
$chart->addData($cos);
$y_axis = new ChartAxis('y');
$y_axis->setDrawLine(false);
$y_axis->setRange(-1, 1);
开发者ID:zoopcommerce,项目名称:mirage,代码行数:31,代码来源:line_chart_sin_cos.php


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