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

PHP Chart类代码示例

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

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



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

示例1: createFromResponse

 public static function createFromResponse(\SimpleXMLElement $response)
 {
     $chart = new Chart();
     $chart->setFrom((int) $response->attributes()->from);
     $chart->setTo((int) $response->attributes()->to);
     return $chart;
 }
开发者ID:kyaroslav,项目名称:BinaryThinkingLastfmBundle,代码行数:7,代码来源:Chart.php


示例2: getChart

 /**
  * @return Chart
  */
 public static function getChart($cate)
 {
     /** @var Chart $chart */
     $chart = new Chart();
     $db = DB::getConn();
     $stm = $db->prepare('select uid, cate, ans from Answers where cate=:cate');
     $stm->bindParam(':cate', $cate);
     $stm->execute();
     $rs = $stm->fetchAll();
     $legends = [];
     foreach ($rs as $r) {
         $results = QuestionCtrl::getResByID($r['uid'], $r['cate']);
         $mark = 0;
         $total = 0;
         foreach ($results as $result) {
             $total += $result->getPoint();
             $mark += $result->getMark();
         }
         if ($total != 0) {
             $legends[] = number_format($mark * 100 / $total, 1, '.', ',');
         }
     }
     $chart->setLegends($legends);
     return $chart;
 }
开发者ID:rmit-s3443163-quan-do,项目名称:its,代码行数:28,代码来源:QuestionCtrl.php


示例3: execute

 public function execute($type_report = '', $id_report = '')
 {
     $selected_id = ($type_report == "grafico" ? "chart_" : "report_") . $id_report;
     $this->showDashboard($selected_id);
     switch ($type_report) {
         case "relatorio":
             include "Report.php";
             $obj = new Report($id_report);
             break;
         case "grafico":
             include "Chart.php";
             $obj = new Chart($id_report);
             break;
     }
     $obj->execute();
 }
开发者ID:renanmedina,项目名称:futuri.easycasting_mvc,代码行数:16,代码来源:ReportManager.php


示例4: init

 public function init()
 {
     parent::init();
     $dataTable = $this->dataTable();
     $jOpts = self::encode($this->options);
     $id = $this->getId();
     $this->getView()->registerJs("var {$id}=new google.visualization.PieChart(document.getElementById('{$id}'));{$id}.draw({$dataTable},{$jOpts});");
 }
开发者ID:yudistirasukma32,项目名称:global_lestari,代码行数:8,代码来源:PieChart.php


示例5: initChart

 /**
  * load jsapi
  */
 private function initChart()
 {
     self::$_first = false;
     $output = '';
     // start a code block
     $output .= '<script type="text/javascript" src="https://www.google.com/jsapi"></script>' . "\n";
     $output .= '<script type="text/javascript">google.load(\'visualization\', \'1.0\', {\'packages\':[\'corechart\']});</script>' . "\n";
     return $output;
 }
开发者ID:nomoregrapes,项目名称:Fair-Food-Carlisle---Community-Edition,代码行数:12,代码来源:GoogleChart.php


示例6: __construct

 public function __construct($width, $height)
 {
     if ($width > self::MAX_WIDTH) {
         throw new InvalidArgumentException(sprintf('Max width for Map Chart is %d.', self::MAX_WIDTH));
     }
     if ($height > self::MAX_HEIGHT) {
         throw new InvalidArgumentException(sprintf('Max height for Map Chart is %d.', self::MAX_HEIGHT));
     }
     parent::__construct('t', $width, $height);
 }
开发者ID:zoopcommerce,项目名称:mirage,代码行数:10,代码来源:MapChart.php


示例7: actionIndex

 public function actionIndex()
 {
     $active_user = User::require_active_user();
     $this->setLayoutVar('active_user', $active_user);
     $this->setVar('active_user', $active_user);
     $this->setLayoutVar('pageTitle', 'Charts');
     $this->setLayoutVar('pageHead', 'Charts');
     $most_snatched = Chart::most_snatched(array('limit' => 10));
     $top_uploaders = Chart::top_uploaders(array('limit' => 10, 'user' => $active_user));
     $this->setVar('most_snatched', $most_snatched);
     $this->setVar('top_uploaders', $top_uploaders);
 }
开发者ID:bencochran,项目名称:yeti,代码行数:12,代码来源:chart.php


示例8: showPage

 public function showPage($selected = '')
 {
     if (!FUTURI_Session::isUserAdmin()) {
         $this->load->view("nopermission_admin");
     }
     $this->load->view("admin_header", array('selected' => $selected));
     switch ($selected) {
         case "usuarios":
             include "application/controllers/User.php";
             define_constants();
             $userController = new User();
             $userController->showListPage('', 10, false);
             break;
         case "estatisticas":
             break;
         case "backups":
             include "application/controllers/Backup.php";
             define_constants();
             $backupController = new Backup();
             $backupController->showListPage('', 10, false);
             break;
         case "configs":
             $this->load->view("admin_configs", array("object_handler" => $this));
             break;
         case "relatorios":
             include "application/controllers/Report.php";
             define_constants();
             $reportController = new Report();
             $reportController->showListPage('', 10, false);
             break;
         case "graficos":
             include "application/controllers/Chart.php";
             define_constants();
             $chartController = new Chart();
             $chartController->showListPage('', 10, false);
             break;
     }
 }
开发者ID:renanmedina,项目名称:futuri.easycasting_mvc,代码行数:38,代码来源:AdminPanel.php


示例9: clearAllReferences

 /**
  * Resets all references to other model objects or collections of model objects.
  *
  * This method is a user-space workaround for PHP's inability to garbage collect
  * objects with circular references (even in PHP 5.3). This is currently necessary
  * when using Propel in certain daemon or large-volumne/high-memory operations.
  *
  * @param boolean $deep Whether to also clear the references on all referrer objects.
  */
 public function clearAllReferences($deep = false)
 {
     if ($deep && !$this->alreadyInClearAllReferencesDeep) {
         $this->alreadyInClearAllReferencesDeep = true;
         if ($this->aUser instanceof Persistent) {
             $this->aUser->clearAllReferences($deep);
         }
         if ($this->aChart instanceof Persistent) {
             $this->aChart->clearAllReferences($deep);
         }
         $this->alreadyInClearAllReferencesDeep = false;
     }
     // if ($deep)
     $this->aUser = null;
     $this->aChart = null;
 }
开发者ID:harivemula,项目名称:datawrapper,代码行数:25,代码来源:BaseJob.php


示例10: init

 public function init()
 {
     parent::init();
     $dataTable = $this->dataTable();
     $jOpts = self::encode($this->options);
     $id = $this->getId();
     if ($this->mode == 'classic') {
         $package = 'corechart';
         $call = "var {$id}=new google.visualization.ColumnChart(document.getElementById('{$id}'));{$id}.draw({$dataTable},{$jOpts});";
     } else {
         $package = 'bar';
         if ($this->mode == 'transition') {
             $jOpts = "google.charts.Bar.convertOptions({$jOpts})";
         }
         $call = "var {$id}=new google.charts.Bar(document.getElementById('{$id}'));{$id}.draw({$dataTable},{$jOpts});";
     }
     $this->packages = [$package];
     $this->getView()->registerJs($call);
 }
开发者ID:yudistirasukma32,项目名称:global_lestari,代码行数:19,代码来源:ColumnChart.php


示例11: report

 public function report()
 {
     // // Group IQs by gender
     // $genderIQs = array();
     // foreach ($this->_humans as $human) {
     //     if ($human instanceof Human) {
     //         $genderIQs[$human->getGender()][] = $human->getIQ();
     //     }
     // }
     // // Output gender IQ distribution
     // foreach ($genderIQs as $gender => $iQs) {
     //     echo $gender . ': ' . count($iQs) . "\n";
     //     echo Chart::output(self::IQ_INIT_BASE - self::IQ_INIT_VAR, self::IQ_INIT_BASE + self::IQ_INIT_VAR, 5, $iQs);
     // }
     $iQs = array();
     foreach ($this->_humans as $human) {
         $iQs[] = $human->getIQ();
     }
     echo 'Count: ' . count($iQs) . "\n";
     echo Chart::output(self::IQ_INIT_BASE - self::IQ_INIT_VAR, self::IQ_INIT_BASE + self::IQ_INIT_VAR, 5, $iQs);
 }
开发者ID:vicch,项目名称:php-play,代码行数:21,代码来源:generation.php


示例12: buildGraph

 /**
  * @return Chart
  */
 public function buildGraph()
 {
     $graph = new Chart($this->width, $this->height);
     $graph->SetScale("datlin");
     $graph->title->Set($this->title);
     $graph->subtitle->Set($this->description);
     $colors = $graph->getThemedColors();
     $graph->xaxis->SetTickLabels($this->burndown_data->getHumanReadableDates());
     $remaining_effort = new LinePlot($this->burndown_data->getRemainingEffort());
     $remaining_effort->SetColor($colors[1] . ':0.7');
     $remaining_effort->SetWeight(2);
     $remaining_effort->SetLegend('Remaining effort');
     $remaining_effort->mark->SetType(MARK_FILLEDCIRCLE);
     $remaining_effort->mark->SetColor($colors[1] . ':0.7');
     $remaining_effort->mark->SetFillColor($colors[1]);
     $remaining_effort->mark->SetSize(3);
     $graph->Add($remaining_effort);
     $ideal_burndown = new LinePlot($this->burndown_data->getIdealEffort());
     $ideal_burndown->SetColor($colors[0] . ':1.25');
     $ideal_burndown->SetLegend('Ideal Burndown');
     $graph->Add($ideal_burndown);
     return $graph;
 }
开发者ID:pombredanne,项目名称:tuleap,代码行数:26,代码来源:BurndownView.class.php


示例13: Chart

<?php

require '../lib/Chart.php';
$chart = new Chart('lc', 500, 200);
$chart->setScale(0, 100);
$line = new ChartData(array(10, 12, 15, 20, 22, 50, 60, 63, 58, 75, 67, 80));
$chart->addData($line);
$y_axis = new ChartAxis('y');
$chart->addAxis($y_axis);
$x_axis = new ChartAxis('x');
$chart->addAxis($x_axis);
if (isset($_GET['debug'])) {
    var_dump($chart->getQuery());
    echo $chart->validate();
    echo $chart->toHtml();
} else {
    header('Content-Type: image/png');
    echo $chart;
}
开发者ID:zoopcommerce,项目名称:mirage,代码行数:19,代码来源:line_chart.php


示例14: displayAccumulatedGraph

 /**
  * Create a JpGraph accumulated barPlot chart 
  *
  * @param Array $bplot Array of JpGraph barPlot objects
  * @param Chart $graph The output graph that will contains accumulated barPlots
  *
  * @return Void
  */
 private function displayAccumulatedGraph($bplot, $graph)
 {
     $abplot = new AccBarPlot($bplot);
     $abplot->SetAbsWidth(10);
     $graph->Add($abplot);
     $graph->Stroke();
 }
开发者ID:nterray,项目名称:tuleap,代码行数:15,代码来源:Git_LastPushesGraph.class.php


示例15: __

" data-date="<?php 
echo $to_date;
?>
" data-date-format="yyyy-mm-dd">
                            <span class="input-group-addon">
                                <span class="glyphicon glyphicon-calendar"></span>
                            </span>
                        </div>
                    </div>
                    <button type="submit" class="btn btn-primary"><?php 
echo __('Filter');
?>
</button>
                </form>

                <br>
                
                <?php 
echo Chart::column($stats_daily, array('title' => __('Views and Ads statistics'), 'height' => 400, 'width' => 800, 'series' => '{0:{targetAxisIndex:1, visibleInLegend: true}}'));
?>
          
                
                
                <?php 
echo Chart::column($stats_orders, array('title' => __('Sales statistics'), 'height' => 400, 'width' => 800, 'series' => '{0:{targetAxisIndex:1, visibleInLegend: true}}'));
?>
                                                              
            </div>
        </div>
    </div> <!-- /.col-md-9 -->
</div> <!-- /.row -->
开发者ID:vericoms,项目名称:openclassifieds2,代码行数:31,代码来源:dashboard.php


示例16: render

 /**
  * Renders a chart
  *
  * @param   img.chart.Chart chart
  * @return  img.Image
  * @throws  lang.IllegalArgumentException if chart is not renderable
  */
 public function render(Chart $chart)
 {
     // Method overloading by delegation
     $method = 'render' . $chart->getSimpleName();
     if (!method_exists($this, $method)) {
         throw new IllegalArgumentException('Cannot render ' . xp::typeOf($chart) . 's');
     }
     return call_user_func_array(array($this, $method), array($chart));
 }
开发者ID:melogamepay,项目名称:xp-framework,代码行数:16,代码来源:ImageRenderer.class.php


示例17: array

<?php

require '../lib/Chart.php';
require '../lib/markers/ChartTextMarker.php';
$values = array();
for ($i = 0; $i <= 10; $i += 1) {
    $values[] = rand(20, 80);
}
$chart = new Chart('bvs', 500, 200);
$chart->setScale(0, 100);
$data = new ChartData($values);
$chart->addData($data);
$marker = new ChartTextMarker();
$marker->setData($data);
$chart->addMarker($marker);
header('Content-Type: image/png');
echo $chart;
开发者ID:zoopcommerce,项目名称:mirage,代码行数:17,代码来源:marker_text_value.php


示例18: array

    ?>
                    <?php 
} else {
    ?>
                         --
                    <?php 
}
?>
                </h2>
                <hr class="statcard-hr">
            </div>
            <?php 
$chart_colors = array(array('fill' => 'rgba(33,150,243,.1)', 'stroke' => 'rgba(33,150,243,.8)', 'point' => 'rgba(33,150,243,.8)', 'pointStroke' => 'rgba(33,150,243,.8)'));
?>
            <?php 
echo Chart::line($current_by_date, array('height' => 94, 'width' => 378, 'options' => array('animation' => false, 'responsive' => true, 'bezierCurve' => true, 'bezierCurveTension' => '.25', 'showScale' => true, 'pointDotRadius' => 0, 'pointDotStrokeWidth' => 0, 'pointDot' => false, 'maintainAspectRatio' => true, 'scaleShowVerticalLines' => false, 'tooltipTemplate' => '<%= datasetLabel %><%= value %>', 'multiTooltipTemplate' => '<%= datasetLabel %><%= value %>', 'showTooltips' => true)), $chart_colors);
?>
        </div>
    </div>
    <div class="col-md-12">
        <div class="statcard statcard-success">
            <ul class="nav nav-pills nav-justified text-center">
                <li role="presentation">
                    <div class="p-a">
                        <span class="statcard-desc"><?php 
echo __('Current');
?>
</span>
                        <h2 class="statcard-number">
                            <?php 
if ($current_total !== NULL) {
开发者ID:Chinese1904,项目名称:openclassifieds2,代码行数:31,代码来源:details.php


示例19: array

        ?>
                            --
                        <?php 
    }
    ?>
                    </h2>
                <?php 
}
?>
                <hr class="statcard-hr">
            </div>
            <?php 
$chart_colors = array(array('fill' => 'rgba(33,150,243,.1)', 'stroke' => 'rgba(33,150,243,.8)', 'point' => 'rgba(33,150,243,.8)', 'pointStroke' => 'rgba(33,150,243,.8)'));
?>
            <?php 
echo Chart::line($current_by_date, array('height' => 94, 'width' => 378, 'options' => array('responsive' => true, 'maintainAspectRatio' => true, 'scaleShowVerticalLines' => false, 'scales' => array('xAxes' => array(array('gridLines' => array('display' => false))), 'yAxes' => array(array('ticks' => array('min' => 0)))), 'legend' => array('display' => false), 'tooltipTemplate' => '<%= datasetLabel %><%= value %>', 'multiTooltipTemplate' => '<%= datasetLabel %><%= value %>')), $chart_colors);
?>
        </div>
    </div>
    <div class="col-md-12">
        <div class="statcard statcard-success">
            <ul class="nav nav-pills nav-justified text-center">
                <li role="presentation">
                    <div class="p-a">
                        <span class="statcard-desc"><?php 
echo __('Current');
?>
</span>
                        <h2 class="statcard-number">
                            <?php 
if ($current_total !== NULL) {
开发者ID:johnulist,项目名称:open-eshop,代码行数:31,代码来源:details.php


示例20: clearAllReferences

 /**
  * Resets all references to other model objects or collections of model objects.
  *
  * This method is a user-space workaround for PHP's inability to garbage collect
  * objects with circular references (even in PHP 5.3). This is currently necessary
  * when using Propel in certain daemon or large-volumne/high-memory operations.
  *
  * @param boolean $deep Whether to also clear the references on all referrer objects.
  */
 public function clearAllReferences($deep = false)
 {
     if ($deep && !$this->alreadyInClearAllReferencesDeep) {
         $this->alreadyInClearAllReferencesDeep = true;
         if ($this->collChartsRelatedById) {
             foreach ($this->collChartsRelatedById as $o) {
                 $o->clearAllReferences($deep);
             }
         }
         if ($this->collJobs) {
             foreach ($this->collJobs as $o) {
                 $o->clearAllReferences($deep);
             }
         }
         if ($this->aUser instanceof Persistent) {
             $this->aUser->clearAllReferences($deep);
         }
         if ($this->aOrganization instanceof Persistent) {
             $this->aOrganization->clearAllReferences($deep);
         }
         if ($this->aChartRelatedByForkedFrom instanceof Persistent) {
             $this->aChartRelatedByForkedFrom->clearAllReferences($deep);
         }
         $this->alreadyInClearAllReferencesDeep = false;
     }
     // if ($deep)
     if ($this->collChartsRelatedById instanceof PropelCollection) {
         $this->collChartsRelatedById->clearIterator();
     }
     $this->collChartsRelatedById = null;
     if ($this->collJobs instanceof PropelCollection) {
         $this->collJobs->clearIterator();
     }
     $this->collJobs = null;
     $this->aUser = null;
     $this->aOrganization = null;
     $this->aChartRelatedByForkedFrom = null;
 }
开发者ID:harivemula,项目名称:datawrapper,代码行数:47,代码来源:BaseChart.php



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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