本文整理汇总了PHP中Chart::draw方法的典型用法代码示例。如果您正苦于以下问题:PHP Chart::draw方法的具体用法?PHP Chart::draw怎么用?PHP Chart::draw使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Chart
的用法示例。
在下文中一共展示了Chart::draw方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: Chart
}
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>';
foreach ($row as $k => $v) {
echo '<td>' . $v . '</td>';
示例2: draw
function draw($image)
{
parent::draw($image);
$this->margin['right'] += $this->depth;
try {
$tb = new Boundary($this->bound->left() + $this->margin['left'], $this->bound->top() + $this->margin['top'] + $this->title['margin']['top'], $this->bound->right() - $this->margin['right'], $this->bound->bottom());
$this->drawTitle($image, $tb);
$ob = new Boundary($this->bound->left() + $this->margin['left'], $tb->bottom() + $this->title['margin']['bottom'], $this->bound->right() - $this->margin['right'], $this->bound->bottom() - $this->margin['bottom']);
$this->drawLegend($image, $ob);
$this->drawValues($image, $ob);
} catch (ChartException $ex) {
(new Label($this->bound, $ex->getMessage(), $this->font_title, $this->color_title, Label::ALIGN_CENTER_MIDDLE))->draw($image);
}
}
示例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: array
$data = $twitterDB->getFavoriteCount();
$chart->load($data, 'array');
$options = array('title' => 'Favorite count', 'is3D' => true, 'width' => 500, 'height' => 400);
} else {
if ($_GET['charts'] == 'max-retweet-count') {
$flag = true;
$data = $twitterDB->getMaxRetweetCount();
$chart->load($data, 'array');
$options = array('title' => 'Max retweet analytics', 'is3D' => true, 'width' => 500, 'height' => 400);
}
}
}
}
}
if ($flag) {
echo $chart->draw('my_div', $options);
}
}
?>
<link href="css/bootstrap.min.css" rel="stylesheet">
<!-- Custom styles for this template -->
<link href="css/twitter.css" rel="stylesheet">
</head>
<body>
<div class="container-fluid">
<div class="row">
<!-- Carousel
================================================== -->
<div id="myCarousel" class="carousel slide" data-ride="carousel">
<!-- Indicators -->
<ol class="carousel-indicators">
示例5: Chart
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>PHP class for Google Chart Tools</title>
<?php
include 'Chart.php';
// demonstration of a line chart and formatted array
$chart = new Chart('LineChart');
$data = array('cols' => array(array('id' => '', 'label' => 'Year', 'type' => 'string'), array('id' => '', 'label' => 'Net income', 'type' => 'number'), array('id' => '', 'label' => 'Revenue', 'type' => 'number')), 'rows' => array(array('c' => array(array('v' => '1990'), array('v' => 150), array('v' => 100))), array('c' => array(array('v' => '1995'), array('v' => 300), array('v' => 50))), array('c' => array(array('v' => '2000'), array('v' => 180), array('v' => 200))), array('c' => array(array('v' => '2005'), array('v' => 400), array('v' => 100))), array('c' => array(array('v' => '2010'), array('v' => 300), array('v' => 600))), array('c' => array(array('v' => '2015'), array('v' => 350), array('v' => 400)))));
$chart->load(json_encode($data));
$options = array('title' => 'revenue', 'theme' => 'maximized', 'width' => 500, 'height' => 200);
echo $chart->draw('revenue', $options);
// demonstration of pie chart and simple array
$chart = new Chart('PieChart');
$data = array(array('mushrooms', 'slices'), array('onions', 2), array('olives', 1), array('cheese', 4));
$chart->load($data, 'array');
$options = array('title' => 'pizza', 'is3D' => true, 'width' => 500, 'height' => 400);
echo $chart->draw('pizza', $options);
?>
</head>
<body>
<div id="revenue"></div>
<div id="pizza"></div>
</body>
</html>
示例6: array
$data = array();
foreach ($results as $row) {
$data[] = array('option' => $row->text, 'votes' => (int) $row->hits);
}
if ($params->get('show_total')) {
$options = array('title' => 'Total Number of Votes: ' . $row->votes, 'is3D' => true, 'chartArea' => array('width' => '80%', 'height' => '75%'), 'legend' => array('position' => 'top'), 'titlePosition' => 'bottom', 'hAxis' => array('showTextEvery' => '1', 'textPosition' => 'out'), 'vAxis' => array('textPosition' => 'out'), 'width' => 300, 'height' => 250);
}
if ($params->get('show_msg')) {
$caption = '<div id="mod_poll_messages_' . $poll->id . '" style="margin:5px;">' . JText::_($msg);
if ($params->get('show_detailed_msg')) {
$caption .= " " . $details;
}
$caption .= '</div>';
}
$chart->load($data, 'array');
echo $chart->draw('polldiv_' . $poll->id, $options);
}
?>
<!-- End of #polldiv -->
</div>
<?php
if (isset($caption)) {
echo '<div style="margin-top:-9px">' . $caption . '</div>';
if ($params->get('show_view_details') || $params->get('rel_article_window')) {
?>
<?php
if ($params->get('show_view_details')) {
?>
示例7: while
if ($invitado) {
for ($i = 0; $i < $num; $i++) {
$array[] = 1500;
}
} else {
include '../../comun/php/ConexionBD.php';
$SQL = "SELECT t,ELO";
$SQL = $SQL . " FROM modificaelo m";
$SQL = $SQL . " WHERE login='{$login}'";
$SQL = $SQL . " ORDER BY t DESC";
$SQL = $SQL . " LIMIT 60";
$result = mysql_query($SQL, $link);
while ($row = mysql_fetch_array($result)) {
$array[] = $row["ELO"];
}
}
$ultimoValor = 1500;
$i = count($array);
if ($i > 0) {
$ultimoValor = $array[$i - 1];
}
for (; $i < $num; $i++) {
$array[] = $ultimoValor;
}
for ($i = 0; $i < count($array); $i++) {
$array[$i] = max(0, $array[$i] - 1000);
}
//colocamos los valores y
//generamos la imagen
$chart->draw(array_reverse($array));
示例8: Chart
}
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>';
} else {
echo '<td>' . $v . '</td>';