本文整理汇总了PHP中Chart::load方法的典型用法代码示例。如果您正苦于以下问题:PHP Chart::load方法的具体用法?PHP Chart::load怎么用?PHP Chart::load使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Chart
的用法示例。
在下文中一共展示了Chart::load方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: Chart
echo '</tr>';
$i++;
}
echo '</table>';
} else {
echo '<div class="report">No delivery orders found.</div>';
}
?>
<?php
echo '<h2 class="report-title">Bottom Selling Produce</h2>';
if (count($reports['bottom_sellers']) > 0) {
//show the chart
$chart = new Chart('ColumnChart');
$chart->load($reports['bottom_sellers'], 'array');
$options = array('is3D' => true, 'width' => 800, 'height' => 400, 'hAxis' => array('title' => 'Produce Name'), 'chartArea' => array('top' => 5, 'height' => '80%'));
echo $chart->draw('bottom_sellers', $options);
echo '<div id="bottom_sellers" class="report-chart"></div>';
//show the data
echo '<table class="report-data">';
echo '<tr>';
echo '<th>Rank</th>';
foreach (current($reports['bottom_sellers']) as $k => $v) {
echo '<th>' . $k . '</th>';
}
echo '</tr>';
$i = 1;
foreach ($reports['bottom_sellers'] as $row_date => $row) {
echo '<tr>';
echo '<td>' . $i . '</td>';
示例2: TwitterDB
<html>
<head>
<?php
include 'TwitterDB.php';
include 'Chart.php';
$twitterDB = new TwitterDB();
//$twitterDB->printArray($_SERVER);
$chart = new Chart('PieChart');
$options = array();
if (!empty($_GET) && isset($_GET) && array_key_exists('charts', $_GET) && !empty($_GET['charts'])) {
$flag = false;
if ($_GET['charts'] == 'retweetcount-vs-text') {
$flag = true;
$data = $twitterDB->getRetweetCountAndText();
$chart->load($data, 'array');
$options = array('title' => 'How many times a tweet is retweeted limited to 10.', 'is3D' => true, 'width' => 500, 'height' => 400);
} else {
if ($_GET['charts'] == 'different-days') {
$flag = true;
$data = $twitterDB->getTweetsOfDifferentDays();
$chart->load($data, 'array');
$options = array('title' => 'Different days tweets analytics', 'is3D' => true, 'width' => 500, 'height' => 400);
} else {
if ($_GET['charts'] == 'status-source') {
$flag = true;
$data = $twitterDB->getStatusSource();
$chart->load($data, 'array');
$options = array('title' => 'Different types of sources used to tweet', 'is3D' => true, 'width' => 500, 'height' => 400);
} else {
if ($_GET['charts'] == 'favorite-count') {
$flag = true;
示例3: createChart
protected function createChart($chartDiv)
{
if (count($this->messageResults) == 0) {
return '';
}
$chart = new Chart('ComboChart');
$data = array();
foreach ($this->messageResults as $row) {
$data[] = array('ID' => $row['id'], 'Sent' => (int) $row['sent'], 'Opened' => (int) $row['openUsers'], 'Clicked' => (int) $row['clickUsers'], 'Bounced' => (int) $row['bouncecount']);
}
$chart->load($data, 'array');
$options = array('height' => self::IMAGE_HEIGHT, 'axisTitlesPosition' => 'out', 'vAxis' => array('title' => 'Subscribers', 'gridlines' => array('count' => 10), 'logScale' => false, 'format' => '#'), 'hAxis' => array('title' => 'Campaign'), 'seriesType' => 'line', 'series' => array(0 => array('type' => 'bars')), 'legend' => array('position' => 'bottom'), 'colors' => array('blue', 'green', 'yellow', 'red'));
$result = $chart->draw($chartDiv, $options);
return $result;
}
示例4: Chart
}
echo '</tr>';
}
echo '</table>';
} else {
echo '<div class="report">No orders made during this time period.</div>';
}
?>
<?php
echo '<h2 class="report-title">Value of Orders</h2>';
if (count($reports['value']) > 0) {
//show the chart
$chart = new Chart('ColumnChart');
$chart->load($reports['value'], 'array');
$options = array('is3D' => true, 'width' => 800, 'height' => 400, 'hAxis' => array('title' => 'Date of Delivery'), 'chartArea' => array('top' => 5, 'height' => '80%'));
echo $chart->draw('report-value', $options);
echo '<div id="report-value" class="report-chart"></div>';
//show the data
echo '<table class="report-data">';
echo '<tr>';
foreach (current($reports['value']) as $k => $v) {
echo '<th>' . $k . '</th>';
}
echo '</tr>';
foreach ($reports['value'] as $row_date => $row) {
echo '<tr>';
foreach ($row as $k => $v) {
if (is_float($v)) {
echo '<td>£' . number_format($v, 2) . '</td>';