本文整理汇总了PHP中x_axis_labels类的典型用法代码示例。如果您正苦于以下问题:PHP x_axis_labels类的具体用法?PHP x_axis_labels怎么用?PHP x_axis_labels使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了x_axis_labels类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: buildChart
protected function buildChart()
{
$chart = $this->getGraph();
// $title = new title('No data');
// $title->set_style('{font-size: 25px;}');
// $chart->set_title($title);
//
$area = $this->createArea();
$dotValues = $this->buildDotValues('#f58615');
$area->set_values($dotValues);
// add the area object to the chart:
$chart->add_element($area);
$y_axis = $this->createYAxis();
$y_axis->set_range(max(0, min($this->values) - 1), max($this->values) + 1);
$y_axis->set_steps(ceil(max($this->values) / 4));
//y_axis legend
$y_legend = new y_legend('Viewers');
$y_legend->set_style('color: #515151; font-size: 12px;');
$chart->set_y_legend($y_legend);
$x_axis = $this->createXAxis();
$x_axis->set_steps(1);
$x_labels = new x_axis_labels();
$x_labels->set_labels(array_values($this->labels));
//$x_labels->set_steps( 1 );
// Add the X Axis Labels to the X Axis
$x_axis->set_labels($x_labels);
$chart->add_y_axis($y_axis);
$chart->x_axis = $x_axis;
return $chart;
}
开发者ID:Spark-Eleven,项目名称:revive-adserver,代码行数:30,代码来源:VastAreaGraph.php
示例2: get_laba_rugi
/**
* Generates data for OFC2 line chart in json format
*
* @return void
*/
public function get_laba_rugi()
{
$this->load->plugin('ofc2');
$this->load->model('jurnal_model');
$model_data = $this->jurnal_model->get_laba_rugi_data();
$bulan_data = array("Jan", "Feb", "Mar", "Apr", "Mei", "Jun", "Jul", "Agu", "Sep", "Okt", "Nov", "Des");
for ($i = date('n') + 1; $i <= 12; $i++) {
$pendapatan_kredit = isset($model_data[$i][date('Y') - 1][4][0]) ? $model_data[$i][date('Y') - 1][4][0] : 0;
$pendapatan_debit = isset($model_data[$i][date('Y') - 1][4][1]) ? $model_data[$i][date('Y') - 1][4][1] : 0;
$beban_kredit = isset($model_data[$i][date('Y') - 1][5][0]) ? $model_data[$i][date('Y') - 1][5][0] : 0;
$beban_debit = isset($model_data[$i][date('Y') - 1][5][1]) ? $model_data[$i][date('Y') - 1][5][1] : 0;
$data[] = $pendapatan_kredit - $pendapatan_debit - ($beban_debit - $beban_kredit);
$thn = date('y') - 1;
$thn = strlen($thn) == 1 ? '0' . $thn : $thn;
$x_data[] = $bulan_data[$i - 1] . "'" . $thn;
}
for ($i = 1; $i <= date('n'); $i++) {
$pendapatan_kredit = isset($model_data[$i][date('Y')][4][0]) ? $model_data[$i][date('Y')][4][0] : 0;
$pendapatan_debit = isset($model_data[$i][date('Y')][4][1]) ? $model_data[$i][date('Y')][4][1] : 0;
$beban_kredit = isset($model_data[$i][date('Y')][5][0]) ? $model_data[$i][date('Y')][5][0] : 0;
$beban_debit = isset($model_data[$i][date('Y')][5][1]) ? $model_data[$i][date('Y')][5][1] : 0;
$data[] = $pendapatan_kredit - $pendapatan_debit - ($beban_debit - $beban_kredit);
$x_data[] = $bulan_data[$i - 1] . "'" . date('y');
}
$max = (int) max($data);
$maxlen = strlen($max);
$up = round($max, -($maxlen - 1));
$min = (int) min($data);
$minlen = strlen($min);
$down = round($min, -($minlen - 1));
$abs_max = (int) max(abs($max), abs($min));
$len = strlen($abs_max);
$round = round($abs_max, -($len - 1));
$step = '1' . substr($round, 1);
$up = $max > $up ? $up + $step : $up;
$down = $min < $down ? $down - $step : $down;
$d = new hollow_dot();
$d->size(4)->halo_size(1)->colour('#668053');
$line = new line();
$line->set_values($data);
$line->set_default_dot_style($d);
$line->set_width(5);
$line->set_colour('#7491a0');
$x_labels = new x_axis_labels();
$x_labels->set_labels($x_data);
$x = new x_axis();
$x->set_labels($x_labels);
$x->set_grid_colour('#bfb8b3');
$y = new y_axis();
$y->set_grid_colour('#bfb8b3');
$y->set_range($down, $up, $step);
$chart = new open_flash_chart();
$chart->add_element($line);
$chart->set_x_axis($x);
$chart->set_y_axis($y);
$chart->set_bg_colour('#FFFFFF');
echo $chart->toPrettyString();
}
开发者ID:andrinda,项目名称:keuangan-guyub,代码行数:63,代码来源:home.php
示例3: set_labels_from_array
function set_labels_from_array($a)
{
$x_axis_labels = new x_axis_labels();
$x_axis_labels->set_labels($a);
$this->labels = $x_axis_labels;
if (isset($this->steps)) {
$x_axis_labels->set_steps($this->steps);
}
}
开发者ID:TianJinRong,项目名称:yiiplayground,代码行数:9,代码来源:ofc_x_axis.php
示例4: setUpGraph
protected function setUpGraph()
{
parent::setUpGraph();
$aDataSets = $this->getDataSets();
// if no data, or only one data point, we don't display the graph
if (count($this->xLabels) <= 1) {
return false;
}
$chart = $this->getGraph();
//set up the axes
$y_axis = $this->createYAxis();
$y_axis->set_range(max(0, $this->getMinYValue() - 1), $this->getMaxYValue() + 1);
$y_axis->set_steps(ceil($this->getMaxYValue() / 4));
$y_axis->set_label_text("#val#" . $this->yUnit);
//y_axis legend
$y_legend = new y_legend('Viewers');
$y_legend->set_style('color: #515151; font-size: 12px;');
$chart->set_y_legend($y_legend);
$x_axis = $this->createXAxis();
$x_values = $this->xLabels;
$xSteps = 5;
if (count($x_values) < $xSteps) {
$xSteps = count($x_values);
} else {
// hack around the set_steps that doesn't seem to work for X axis
foreach ($x_values as $i => &$xValue) {
if ($i % $xSteps != 0) {
$xValue = '';
}
}
}
$x_axis->set_steps($xSteps);
$x_labels = new x_axis_labels();
$x_labels->set_labels($x_values);
// Add the X Axis Labels to the X Axis
$x_axis->set_labels($x_labels);
$chart->add_y_axis($y_axis);
$chart->x_axis = $x_axis;
$oColorHelper = new Graph_DataSetColorsHelper();
foreach ($aDataSets as $aDataSet) {
$values = $aDataSet['values'];
$name = $aDataSet['name'];
$aColors = $oColorHelper->getNextColors();
$dotValues = $this->buildDotValues($aColors['line'], $values, $name);
$area = $this->createArea($aColors['line'], $aColors['fill']);
$area->set_fill_alpha("0.1");
$area->set_values($dotValues);
$area->set_text($name);
// add the area object to the chart:
$chart->add_element($area);
}
return $chart;
}
开发者ID:Spark-Eleven,项目名称:revive-adserver,代码行数:53,代码来源:VastMultiAreaGraph.php
示例5: get_statistic
function get_statistic()
{
$this->load->library('OpenFlashChartLib', NULL, 'OFCL');
$data_1 = array();
$data_2 = array();
// generate 7 data points
for ($i = 0; $i <= 7; $i++) {
$x = mktime(0, 0, 0, date("m"), date("d") - $i, date('Y'));
$param['sms_date'] = date('Y-m-d', mktime(0, 0, 0, date("m"), date("d") - $i, date("Y")));
$param['user_id'] = $this->session->userdata('id_user');
$y = $this->Kalkun_model->get_sms_used('date', $param);
$data_1[] = new scatter_value($x, $y);
$data_2[] = $y;
}
$def = new solid_dot();
$def->size(4)->halo_size(0)->colour('#21759B')->tooltip('#date:d M y#<br>#val# SMS');
$line = new scatter_line('#21759B', 3);
$line->set_values($data_1);
$line->set_default_dot_style($def);
$line->set_key("SMS used in last 7 days", 10);
$x = new x_axis();
// grid line and tick every 10
$x->set_range(mktime(0, 0, 0, date("m"), date("d") - 7, date('Y')), mktime(0, 0, 0, date("m"), date("d"), date('Y')));
// show ticks and grid lines for every day:
$x->set_steps(86400);
$labels = new x_axis_labels();
// tell the labels to render the number as a date:
$labels->text('#date:M-d#');
// generate labels for every day
$labels->set_steps(86400);
// only display every other label (every other day)
$labels->visible_steps(1);
$labels->rotate(45);
// finally attach the label definition to the x axis
$x->set_labels($labels);
$y = new y_axis();
if (max($data_2) > 0) {
$max = max($data_2);
} else {
$max = 10;
}
$y->set_range(0, $max, 10);
$chart = new open_flash_chart();
//$chart->set_title( $title );
$chart->add_element($line);
$chart->set_x_axis($x);
$chart->set_y_axis($y);
echo $chart->toPrettyString();
}
开发者ID:Git-Host,项目名称:kalkun_0.21,代码行数:49,代码来源:kalkun.php
示例6: render
/**
* Method to render a statistical chart using Open Flash library.
*
* @return false if someting wrong
*/
function render()
{
$values = array();
foreach ($this->values as $number_variable => $variable) {
$values[$number_variable] = (int) $variable;
}
$area = new area();
$area->set_default_dot_style(new hollow_dot());
$area->set_colour('#5B56B6');
$area->set_fill_alpha(0.4);
$area->set_values($values);
$area->set_key('Values', 12);
$x_labels = new x_axis_labels();
$x_labels->set_steps(1);
$x_labels->set_vertical();
$x_labels->set_colour('#A2ACBA');
$x_labels->set_labels($this->legend);
$x = new x_axis();
$x->set_colour('#A2ACBA');
$x->set_grid_colour('#D7E4A3');
$x->set_offset(false);
$x->set_steps(1);
// Add the X Axis Labels to the X Axis
$x->set_labels($x_labels);
$y = new y_axis();
$y_max = max($values) > 0 ? max($values) : 4;
$y_mod = (int) ($y_max / 4 + 1);
$y_max += $y_mod - $y_max % $y_mod;
$y->set_range(0, $y_max, $y_mod);
$y->labels = null;
$y->set_offset(false);
$chart = new open_flash_chart();
$chart->set_x_axis($x);
$chart->add_y_axis($y);
$chart->add_element($area);
return $chart;
}
开发者ID:madseller,项目名称:coperio,代码行数:42,代码来源:openflashrenderer.php
示例7: _render_statistic
function _render_statistic($x = array(), $yout = array(), $yin = array(), $type = 'bar', $points)
{
$this->load->helper('date');
$this->load->library('OpenFlashChartLib', NULL, 'OFCL');
$data_1 = array();
$data_2 = array();
$data_3 = array();
switch ($type) {
case 'bar':
for ($i = 0; $i <= $points; $i++) {
$data_1[$i] = $x[$i];
$data_2[$i] = (int) $yout[$i];
// force to integer
$data_3[$i] = (int) $yin[$i];
// force to integer
}
$data_1 = array_reverse($data_1);
$data_2 = array_reverse($data_2);
$data_3 = array_reverse($data_3);
$bar_1 = new bar();
$bar_1->set_values($data_3);
$bar_1->set_colour('#639F45');
$bar_1->key(lang('kalkun_incoming_sms'), 10);
$bar_1->set_tooltip('#x_label#<br>#val# SMS');
//$bar_1->set_key("SMS used in last 7 days", 10);
$bar_2 = new bar();
$bar_2->set_values($data_2);
$bar_2->set_colour('#21759B');
$bar_2->key(lang('kalkun_outgoing_sms'), 10);
$bar_2->set_tooltip('#x_label#<br>#val# SMS');
$x = new x_axis();
$labels = new x_axis_labels();
$labels->set_labels($data_1);
$labels->set_steps(1);
$x->set_labels($labels);
$y = new y_axis();
$max = max(max($data_2), max($data_3));
if ($max < 10) {
$max = 10;
}
$max = ceil($max / 5) * 5;
$range = ceil($max / 5);
$range = ceil($range / 10) * 10;
$y->set_range(0, $max, $range);
$element1 = $bar_1;
$element2 = $bar_2;
break;
case 'line':
for ($i = 0; $i <= 7; $i++) {
$data_1[$i] = new scatter_value($x[$i], $yin[$i]);
$data_2[$i] = new scatter_value($x[$i], $yout[$i]);
$data_3[$i] = (int) $yin[$i];
$data_4[$i] = (int) $yout[$i];
}
$def = new solid_dot();
$def->size(4)->halo_size(0)->colour('#21759B')->tooltip('#date:d M y#<br>#val# SMS');
$line_1 = new scatter_line('#639F45', 3);
$line_1->set_values($data_1);
$line_1->set_default_dot_style($def);
$line_1->set_key("Incoming SMS", 10);
$line_2 = new scatter_line('#21759B', 3);
$line_2->set_values($data_2);
$line_2->set_default_dot_style($def);
$line_2->set_key("Outgoing SMS", 10);
$x = new x_axis();
// grid line and tick every 10
$x->set_range(mktime(0, 0, 0, date("m"), date("d") - 7, date('Y')), mktime(0, 0, 0, date("m"), date("d"), date('Y')));
// show ticks and grid lines for every day:
$x->set_steps(86400);
$labels = new x_axis_labels();
// tell the labels to render the number as a date:
$labels->text('#date:M-d#');
// generate labels for every day
$labels->set_steps(86400);
// only display every other label (every other day)
$labels->visible_steps(1);
$labels->rotate(45);
// finally attach the label definition to the x axis
$x->set_labels($labels);
$y = new y_axis();
$max = max(max($data_3), max($data_4));
if ($max < 1) {
$max = 10;
}
$y->set_range(0, $max, round($max / 100) * 10);
$element1 = $line_1;
$element2 = $line_2;
break;
}
$chart = new open_flash_chart();
$chart->add_element($element1);
$chart->add_element($element2);
$chart->set_x_axis($x);
$chart->set_y_axis($y);
echo $chart->toPrettyString();
}
开发者ID:sugengstiki,项目名称:Kalkun,代码行数:96,代码来源:kalkun.php
示例8: array
');
$deposits = array();
$withdrawals = array();
$weeks = array();
while ($row = mysql_fetch_assoc($result)) {
$weeks[] = date('d.m.Y', $row['stamp']);
$deposits[] = round($row['deposits'], 2);
$withdrawals[] = -round($row['withdrawals'], 2);
}
//lines
$line1 = new line();
$line1->set_values($deposits);
$line1->set_colour('#00FF00');
$line2 = new line();
$line2->set_values($withdrawals);
$line2->set_colour('#FF0000');
//axises
$axis_x = new x_axis();
$axis_x_labels = new x_axis_labels();
$axis_x_labels->set_labels($weeks);
$axis_x->set_labels($axis_x_labels);
$axis_y = new y_axis();
$axis_y->range(0, max(max($deposits), max($withdrawals)), 1000);
//chart
$chart = new open_flash_chart();
$chart->set_y_axis($axis_y);
$chart->set_x_axis($axis_x);
$chart->add_element($line1);
$chart->add_element($line2);
$chart->set_bg_colour('#FFFFFF');
echo $chart->toPrettyString();
开发者ID:andrii888,项目名称:VFXHYIP,代码行数:31,代码来源:chart-data.php
示例9: explode
$tmp = explode(" ", $line);
$datalist[] = 1 * $tmp[1];
$labellist[] = $tmp[0];
}
//Prevent error on no data
if (count($datalist < 1)) {
$datalist[] = 0;
$labellist[] = 0;
}
$title = new title("Checking account forecast");
$default_dot = new dot();
$default_dot->tooltip('$#val#');
$line = new line();
$line->set_values($datalist);
$line->set_default_dot_style($default_dot);
$x_labels = new x_axis_labels();
$x_labels->rotate(45);
$x_labels->set_labels($labellist);
$x_labels->set_steps(3);
$x = new x_axis();
$x->set_labels($x_labels);
$y = new y_axis();
$y->set_range(min(min($datalist) - 10, 0), round(max($datalist) * 1.1));
$y->set_label_text("\$#val#");
$chart = new open_flash_chart();
$chart->set_title($title);
$chart->add_element($line);
$chart->set_x_axis($x);
$chart->set_y_axis($y);
$chart->set_bg_colour('#FFFFFF');
echo $chart->toPrettyString();
开发者ID:bettse,项目名称:ledger-ofc,代码行数:31,代码来源:year_overview.php
示例10: GetRenderContent
//.........这里部分代码省略.........
$aLabels[$iRow] = strip_tags($sHtmlValue);
$aGroupBy[$iRow] = (int) $aRow['_itop_count_'];
$iTotalCount += $aRow['_itop_count_'];
}
$aData = array();
$aChartLabels = array();
$maxValue = 0;
foreach ($aGroupBy as $iRow => $iCount) {
$oBarValue = new bar_value($iCount);
$oBarValue->on_click("ofc_drill_down_{$sId}");
$aData[] = $oBarValue;
if ($iCount > $maxValue) {
$maxValue = $iCount;
}
$aChartLabels[] = html_entity_decode($aLabels[$iRow], ENT_QUOTES, 'UTF-8');
}
$oYAxis = new y_axis();
$aMagicValues = array(1, 2, 5, 10);
$iMultiplier = 1;
$index = 0;
$iTop = $aMagicValues[$index % count($aMagicValues)] * $iMultiplier;
while ($maxValue > $iTop) {
$index++;
$iTop = $aMagicValues[$index % count($aMagicValues)] * $iMultiplier;
if ($index % count($aMagicValues) == 0) {
$iMultiplier = $iMultiplier * 10;
}
}
//echo "oYAxis->set_range(0, $iTop, $iMultiplier);\n";
$oYAxis->set_range(0, $iTop, $iMultiplier);
$oChart->set_y_axis($oYAxis);
$oChartElement->set_values($aData);
$oXAxis = new x_axis();
$oXLabels = new x_axis_labels();
// set them vertical
$oXLabels->set_vertical();
// set the label text
$oXLabels->set_labels($aChartLabels);
// Add the X Axis Labels to the X Axis
$oXAxis->set_labels($oXLabels);
$oChart->set_x_axis($oXAxis);
}
break;
case 'pie':
default:
$oChartElement = new pie();
$oChartElement->set_start_angle(35);
$oChartElement->set_animate(true);
$oChartElement->set_tooltip('#label# - #val# (#percent#)');
$oChartElement->set_colours(array('#FF8A00', '#909980', '#2C2B33', '#CCC08D', '#596664'));
if (isset($aExtraParams['group_by'])) {
if (isset($aExtraParams['group_by_label'])) {
$oGroupByExp = Expression::FromOQL($aExtraParams['group_by']);
$sGroupByLabel = $aExtraParams['group_by_label'];
} else {
// Backward compatibility: group_by is simply a field id
$sAlias = $this->m_oFilter->GetClassAlias();
$oGroupByExp = new FieldExpression($aExtraParams['group_by'], $sAlias);
$sGroupByLabel = MetaModel::GetLabel($this->m_oFilter->GetClass(), $aExtraParams['group_by']);
}
$aGroupBy = array();
$aGroupBy['grouped_by_1'] = $oGroupByExp;
$sSql = $this->m_oFilter->MakeGroupByQuery($aQueryParams, $aGroupBy, true);
$aRes = CMDBSource::QueryToArray($sSql);
$aGroupBy = array();
$aLabels = array();
开发者ID:henryavila,项目名称:itop,代码行数:67,代码来源:displayblock.class.inc.php
示例11: index2Action
public function index2Action()
{
$this->_helper->layout->disableLayout();
include 'open-flash-chart.php';
$db = Zend_Registry::get('db');
$select = $db->select();
$select->from('report', array('left(create_date,10) as date', 'count(*)'))->where('report.campaign_id = 3')->where("report.state = 'APPROVED'")->group('date')->order('date')->limit(0);
$results = $db->fetchAll($select);
$array_data = array();
$array_create_date = array();
foreach ($results as $result) {
array_push($array_data, (int) $result["count(*)"]);
array_push($array_create_date, $result["date"]);
}
$title = new title("BugsLock Reports By Day");
$y = new y_axis();
$y->set_range(0, 100, 10);
$x = new x_axis();
$x_labels = new x_axis_labels();
$x_labels->set_labels($array_create_date);
$x_labels->set_steps(2);
$x_labels->rotate(40);
$x->set_labels($x_labels);
//There is a bug on the tooltip of bar: can not show #x_label#. So use bar_stack instead of bar here.
// $bar = new bar_filled( '#E2D66A', '#577261' );
// $bar->set_values($array_data);
// $bar->set_tooltip('#x_label#: #val#');
$bar = new bar_stack();
$bar->set_colours(array('#E2D66A', '#577261'));
foreach ($array_data as $date) {
$bar->append_stack(array((int) $date));
}
$bar->set_tooltip('#x_label#: #val#');
$this->view->chart3 = new open_flash_chart();
$this->view->chart3->set_title($title);
$this->view->chart3->add_element($bar);
$this->view->chart3->set_bg_colour('#FFFFFF');
$this->view->chart3->set_x_axis($x);
$this->view->chart3->set_y_axis($y);
// echo $this->view->chart3->toPrettyString();
}
开发者ID:omusico,项目名称:wildfire_php,代码行数:41,代码来源:TestController.php
示例12: x_axis
$maximum = $maxima[0];
//-----/end get ranges -----------------
// Prepare the x-axis
$x = new x_axis();
$x->set_range($lowest, $highest);
// Calculate the steps and visible steps
$step = ($highest - $lowest) / 60;
$step_vis = 2;
// do not allow steps to be less than 30 minutes
if ($step < 26400) {
# 86400
$step = 26400;
$step_vis = 1;
}
$x->set_steps($step);
$labels = new x_axis_labels();
$labels->text('#date:Y-m-d#');
$labels->set_steps($step);
$labels->visible_steps($step_vis);
$labels->rotate(90);
$x->set_labels($labels);
// Prepare the y-axis
$y = new y_axis();
// $maximum is already set above
// set the range and y-step
$y->set_range(0, $maximum + getIdealYSteps($maximum));
$y->set_steps(getIdealYSteps($maximum));
# $chart->add_element( $s );
$chart->set_x_axis($x);
$chart->add_y_axis($y);
// echo a pretty ofc-string anyway
开发者ID:minggLu,项目名称:openemr,代码行数:31,代码来源:graph_track_anything.php
示例13: while
while ($val = mssql_fetch_assoc($result)) {
$kecamatan[] = $val['Kecamatan'];
$jumlah[] = $val['Jumlah'];
$total = $val['total'];
$tempJumlah = $val['Jumlah'];
$maxJumlah = $maxJumlah > $tempJumlah ? $maxJumlah : $tempJumlah;
}
}
$max = 0;
$title = new title('Jumlah Data Peserta KB Per Kecamatan, Total : ' . $total . ' ( ' . date("D M d Y") . ' ) ');
$title->set_style('{font-size:20px; color: #bcd6ff; margin:0px; background-color: #5E83BF;}');
$bar = new bar_3d();
$bar->set_values($jumlah);
$bar->colour = '#9999FF';
$bar->set_on_show(new bar_on_show('grow-up', 1, 0));
$labels = new x_axis_labels();
$labels->set_labels($kecamatan);
$y_base = new y_axis_base();
$y_base->set_range(0, $maxJumlah + round($maxJumlah / 2), round($maxJumlah / 10));
$x = new x_axis();
$x->set_labels($labels);
$x->set_3d(5);
$y = new y_axis();
$y->set_labels($y_labels);
$tags = new ofc_tags();
$tags->font('Verdana', 10)->colour('#000000')->align_x_center()->text('#y#');
$i = 0;
foreach ($jumlah as $j) {
$tags->append_tag(new ofc_tag($i, $j));
$i++;
}
开发者ID:aldrymaulana,项目名称:mdk-php,代码行数:31,代码来源:jml-mdk-per-kecamatan.php
示例14: foreach
foreach (array_keys($requests) as $s) {
if ($max_rec < intval($requests[$s])) {
$max_rec = intval($requests[$s]);
}
$request[] = intval($requests[$s]);
}
$chart = new open_flash_chart();
$title = new title('Weekly Requests');
$title->set_style("{font-size: 20px; color: #A2ACBA; text-align: center;}");
$chart->set_title($title);
$chart->set_bg_colour('#FFFFFF');
$area = new area();
$area->set_colour('#5B56B6');
$area->set_values($request);
$chart->add_element($area);
$x_labels = new x_axis_labels();
$x_labels->set_vertical();
$x_labels->set_colour('#A2ACBA');
$x_labels->set_labels($week);
$x = new x_axis();
$x->set_colour('#A2ACBA');
$x->set_grid_colour('#D7E4A3');
$x->set_offset(false);
$x->set_steps(4);
$x->set_labels($x_labels);
$chart->set_x_axis($x);
$x_legend = new x_legend(date("D M d Y"));
$x_legend->set_style('{font-size: 20px; color: #778877}');
$chart->set_x_legend($x_legend);
//
// remove this when the Y Axis is smarter
开发者ID:AviMoto,项目名称:webekci,代码行数:31,代码来源:source_ip_trend.php
示例15: y_axis
}
}
if (empty($array)) $array[] = 0;
$bar->set_values( $array );
$bar->set_tooltip("#val#<br>Average = ".commify($avg[0]));
$bar2->set_values( ($avg) );
$bar2->set_colour( "#40FF40" );
$bar2->set_tooltip("#val#<br>Average [#x_label#]");
//
// create a Y Axis object
//
$y = new y_axis();
// grid steps:
$y->set_range( 0, max($array), round(max($array)/10));
$chart->set_y_axis( $y );
$x_labels = new x_axis_labels();
$x_labels->set_vertical();
$x_labels->set_labels( $hms );
$x = new x_axis();
$x->set_labels( $x_labels );
$chart->set_x_axis( $x );
echo $chart->toPrettyString();
break;
case "chart_mpd":
$title = new title( date("D M d Y") );
$bar = new bar_rounded_glass();
// -------------------------
// Get Messages Per Day
// -------------------------
$array = array();
开发者ID:Russell-IO,项目名称:php-syslog-ng,代码行数:31,代码来源:json.charts.php
示例16: _setChartdata
/**
* assign the chartdata object for open flash chart library
* @param $config
* @return unknown_type
*/
function _setChartdata($config)
{
$model = $this->getModel();
$rounds = $this->get('Rounds');
$round_labels = array();
foreach ($rounds as $r) {
$round_labels[] = $r->name;
}
$division = $this->get('division');
$data = $model->getDataByDivision($division->id);
//create a line
$length = count($rounds) - 0.5;
$linewidth = $config['color_legend_line_width'];
$lines = array();
//$title = $division->name;
$chart = new open_flash_chart();
//$chart->set_title( $title );
$chart->set_bg_colour($config['bg_colour']);
//colors defined for ranking table lines
//todo: add support for more than 2 lines
foreach ($this->colors as $color) {
foreach ($rounds as $r) {
for ($n = $color['from']; $n <= $color['to']; $n++) {
$lines[$color['color']][$n][] = $n;
}
}
}
//set lines on the graph
foreach ($lines as $key => $value) {
foreach ($value as $line => $key2) {
$chart->add_element(hline($key, $length, $line, $linewidth));
}
}
//load team1, first team in the dropdown
$team = $this->team1;
$d = new $config['dotstyle_1']();
$d->size((int) $config['line1_dot_strength']);
$d->halo_size(1);
$d->colour($config['line1']);
$d->tooltip('Rank: #val#');
$line = new line();
$line->set_default_dot_style($d);
$line->set_values($team->rankings);
$line->set_width((int) $config['line1_strength']);
$line->set_key($team->name, 12);
$line->set_colour($config['line1']);
$line->on_show(new line_on_show($config['l_animation_1'], $config['l_cascade_1'], $config['l_delay_1']));
$chart->add_element($line);
//load team2, second team in the dropdown
$team = $this->team2;
$d = new $config['dotstyle_2']();
$d->size((int) $config['line2_dot_strength']);
$d->halo_size(1);
$d->colour($config['line2']);
$d->tooltip('Rank: #val#');
$line = new line();
$line->set_default_dot_style($d);
$line->set_values($team->rankings);
$line->set_width((int) $config['line2_strength']);
$line->set_key($team->name, 12);
$line->set_colour($config['line2']);
$line->on_show(new line_on_show($config['l_animation_2'], $config['l_cascade_2'], $config['l_delay_2']));
$chart->add_element($line);
$x = new x_axis();
if ($config['x_axis_label'] == 1) {
$xlabels = new x_axis_labels();
$xlabels->set_labels($round_labels);
$xlabels->set_vertical();
}
$x->set_labels($xlabels);
$x->set_colours($config['x_axis_colour'], $config['x_axis_colour_inner']);
$chart->set_x_axis($x);
$x_legend = new x_legend(JText::_('COM_JOOMLEAGUE_CURVE_ROUNDS'));
$x_legend->set_style('{font-size: 15px; color: #778877}');
$chart->set_x_legend($x_legend);
$y = new y_axis();
$y->set_range(count($data), 1, -1);
$y->set_colours($config['x_axis_colour'], $config['x_axis_colour_inner']);
$chart->set_y_axis($y);
$y_legend = new y_legend(JText::_('COM_JOOMLEAGUE_CURVE_RANK'));
$y_legend->set_style('{font-size: 15px; color: #778877}');
$chart->set_y_legend($y_legend);
ob_clean();
echo $chart->toString();
}
开发者ID:Heart1010,项目名称:JoomLeague,代码行数:90,代码来源:view.raw.php
示例17: renderHTML
//.........这里部分代码省略.........
}
/* 14 - 2^13 PUBLISH */
if ($r_methods & 8192) {
$ul_methods['PUBLISH'] = $ul_methods['PUBLISH'] + 1;
}
/* 15 - 2^14 OTHER */
if ($r_methods & 16384) {
$ul_methods['OTHERS'] = $ul_methods['OTHERS'] + 1;
}
} else {
$ul_methods['NONE'] = $ul_methods['NONE'] + 1;
}
/* supported NAT stats */
if (isset($r_cflags) && $r_cflags != 0) {
if ($r_cflags & 1 << 6) {
$ul_nat['NATTED'] = $ul_nat['NATTED'] + 1;
}
if ($r_cflags & 1 << 7) {
$ul_nat['SIPPING'] = $ul_nat['SIPPING'] + 1;
}
}
$yidx = $yidx + 1;
}
if ($yidx > 0) {
$ousr++;
if ($prevcnt < 5) {
$ul_contacts[$prevcnt] = $ul_contacts[$prevcnt] + 1;
} else {
$ul_contacts[5] = $ul_contacts[5] + 1;
}
}
/* user agents chart */
$ua_title = new title('User Agents');
$ua_x_labels = new x_axis_labels();
$ua_x_labels->rotate(20);
$ua_bar = new bar_glass();
$chart_vals = array();
$chart_lbls = array();
$i = 0;
$ymax = 10;
foreach ($ul_uas as $key => $val) {
if ($val > 0) {
$chart_vals[$i] = new bar_value($val);
$chart_vals[$i]->set_colour($chart_colors[$i % $chart_colors_size]);
$chart_vals[$i]->set_tooltip($key . '<br>#val#');
$chart_lbls[$i] = $key;
if ($ymax < $val) {
$ymax = $val;
}
$i = $i + 1;
}
}
$ua_bar->set_values($chart_vals);
$ua_x_labels->set_labels($chart_lbls);
$x = new x_axis();
$x->set_labels($ua_x_labels);
$y = new y_axis();
$y->set_range(0, $ymax, $ymax / 10);
$ul_uas_chart = new open_flash_chart();
$ul_uas_chart->set_title($ua_title);
$ul_uas_chart->add_element($ua_bar);
$ul_uas_chart->set_x_axis($x);
$ul_uas_chart->add_y_axis($y);
/* supported SIP Methods chart */
$mt_title = new title('Supported SIP Methods');
$mt_x_labels = new x_axis_labels();
开发者ID:que273,项目名称:siremis,代码行数:67,代码来源:ChartsStatsUlsForm.php
示例18: get_jx_json_bar
public function get_jx_json_bar($info, $type = '')
{
$year = array_keys($info);
$price = array_values($info);
$chart = new open_flash_chart();
$chart->set_bg_colour('#FFFFFF');
//flash背景颜色
$x_labels = new x_axis_labels();
$x_labels->set_steps(1);
$x_labels->set_size(12);
$x_labels->set_colour('#000000');
if (count($year) > 0) {
$x_labels->set_vertical();
}
$x_labels->set_labels($year);
// // 插入数据
$x = new x_axis();
$x->set_colour('#000000');
$x->set_grid_colour('#dadada');
$x->set_offset(true);
$x->set_steps(1);
// Add the X Axis Labels to the X Axis
$x->set_labels($x_labels);
$x->set_offset(true);
$chart->set_x_axis($x);
// $bar = new bar_filled( '#74b1e0', '#9dc7e8' );
// $bar->set_values( $price );
$price_array = array();
foreach ($price as $k => $v) {
$price_array[$k] = new bar_value($v);
$price_array[$k]->set_colour('#74b1e0');
if ($type == 'percent') {
//$y->set_label_text("#val#%");
$price_array[$k]->set_tooltip($year[$k] . '<br>' . '' . number_format($v) . '%');
} else {
$price_array[$k]->set_tooltip($year[$k] . '<br>' . '' . number_format($v));
}
}
$bar = new bar_glass();
$bar->set_values($price_array);
$chart->add_element($bar);
//
// LOOK:
//
//$x_legend = new x_legend( '1983 to 2008' );
//$x_legend->set_style( '{font-size: 20px; color: #778877}' );
//$chart->set_x_legend( $x_legend );
//
// remove this when the Y Axis is smarter
//
$y = new y_axis();
$max = $this->get_the_right_y(max($price));
$max = $max > 0 ? $max : 1;
$y->set_range(0, ($max / 5 + 1) * 5, $max / 5 + 1);
// if ($max > 20 && $max <= 100) {
//
// $y->set_range(0, $max, 10);
// }elseif($max >= 10&&$max<=20){
// $y->set_range(0, $max, 5);
// }
// else {
// $y->set_range(0, $max);
// }
$y->set_colour('#000000');
$y->set_grid_colour('#dadada');
if ($type == 'percent') {
$y->set_label_text(" #val#%");
} else {
$y->set_label_text(" #val#");
}
$chart->add_y_axis($y);
$info = $chart->toPrettyString();
return $info;
}
开发者ID:myjavawork,项目名称:sanxin-fangwei,代码行数:74,代码来源:CommonAction.class.php
示例19: getNewUsersByTime
function getNewUsersByTime($timePhase, $fromDate = '', $toDate = '')
{
$this->load->library('ofc');
$userId = $this->common->getUserId();
$this->ofc->open_flash_chart();
$this->ofc->set_bg_colour(CHART_BG_COLOR);
$toTime = date("Y-m-d", strtotime("-1 day"));
if ($timePhase == "7day") {
$fromTime = date("Y-m-d", strtotime("-8 day"));
$color = CHART_LINE_1;
$key = "近7日新增用户";
$title = new title("近7日新增用户统计");
}
if ($timePhase == "1month") {
$title = new title("近30天新增用户统计");
$fromTime = date("Y-m-d", strtotime("-31 day"));
$color = CHART_LINE_2;
$key = "近30天新增用户统计";
}
if ($timePhase == "3month") {
$title = new title("近三个月新增用户统计");
$fromTime = date("Y-m-d", strtotime("-92 day"));
$color = CHART_LINE_3;
$key = "近三个月新增用户统计";
}
if ($timePhase == "all") {
$title = new title("所有新增用户统计");
$fromTime = '1970-01-01';
$color = CHART_LINE_4;
$key = "所有新增用户统计";
}
if ($timePhase == "any") {
$title = new title("所有新增用户统计");
$fromTime = $fromDate;
$toTime = $toDate;
$color = CHART_LINE_4;
$key = "所有新增用户统计";
}
$fromTime = $this->product->getUserStartDate($userId, $fromTime);
$query = $this->newusermodel->getNewUsersByUserId($fromTime, $toTime, $userId);
$data = array();
$maxY = 0;
$recordCount = $query->num_rows();
$steps = $recordCount - 1 <= 10 ? 2 : (int) (((int) $recordCount - 1) / 10);
$xlabelArray = array();
if ($query != null && $query->num_rows() > 0) {
foreach ($query->result() as $row) {
$dot = new dot();
$dot->size(3)->halo_size(1)->colour($color);
$dot->tooltip($row->startdate . " 新增" . $row->totalusers . "用户");
$dot->value((int) $row->totalusers);
if ((int) $row->totalusers > $maxY) {
$maxY = (int) $row->totalusers;
}
array_push($xlabelArray, date('y-m-d', strtotime($row->startdate)));
array_push($data, $dot);
}
}
$y = new y_axis();
$y->set_range(0, $this->common->getMaxY($maxY), $this->common->getStepY($maxY));
$x = new x_axis();
$x->set_range(0, $recordCount > 1 ? $recordCount - 1 : 1);
$x_labels = new x_axis_labels();
$x_labels->set_steps($steps);
|
请发表评论