本文整理汇总了PHP中x_axis类的典型用法代码示例。如果您正苦于以下问题:PHP x_axis类的具体用法?PHP x_axis怎么用?PHP x_axis使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了x_axis类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: 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
示例2: 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
示例3: xAxis
/**
* undocumented function
*
* @param string $options
* @return void
* @access public
*/
function xAxis($options)
{
$x = null;
if (isset($options['x_axis'])) {
$x = new x_axis();
$xOptions = $options['x_axis'];
if (isset($xOptions['color'])) {
$x->colour($xOptions['color']);
}
if (isset($xOptions['grid_colour'])) {
$x->grid_colour($xOptions['grid_colour']);
}
if (isset($xOptions['tick_height'])) {
$x->tick_height($xOptions['tick_height']);
}
if (isset($xOptions['stroke'])) {
$x->stroke($xOptions['stroke']);
}
if (isset($xOptions['labels'])) {
$x->set_labels_from_array($xOptions['labels']);
if (isset($xOptions['label_direction'])) {
$x->labels->set_vertical();
}
}
}
return $x;
}
开发者ID:stripthis,项目名称:donate,代码行数:34,代码来源:open_flash_chart.php
示例4: 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
示例5: _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
示例6: 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
示例7: title
}
//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,代码行数:29,代码来源:year_overview.php
示例8: GetRenderContent
//.........这里部分代码省略.........
$sHtmlValue = $oGroupByExp->MakeValueLabel($this->m_oFilter, $sValue, $sValue);
$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();
开发者ID:henryavila,项目名称:itop,代码行数:67,代码来源:displayblock.class.inc.php
示例9: 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
示例10: 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
示例11: _setChartdata
function _setChartdata($config)
{
require_once JLG_PATH_SITE . '/assets/classes/open-flash-chart/open-flash-chart.php';
$data = $this->get('ChartData');
// Calculate Values for Chart Object
$forSum = array();
$againstSum = array();
$matchDayGoalsCount = array();
$round_labels = array();
foreach ($data as $rw) {
if (!$rw->homegoalspd) {
$rw->homegoalspd = 0;
}
if (!$rw->guestgoalspd) {
$rw->guestgoalspd = 0;
}
$homeSum[] = (int) $rw->homegoalspd;
$awaySum[] = (int) $rw->guestgoalspd;
// check, if both results are missing and avoid drawing the flatline of "0" goals for not played games yet
if (!$rw->homegoalspd && !$rw->guestgoalspd) {
$matchDayGoalsCount[] = null;
} else {
$matchDayGoalsCount[] = (int) $rw->homegoalspd + $rw->guestgoalspd;
}
$round_labels[] = $rw->roundcode;
}
$chart = new open_flash_chart();
//$chart->set_title( $title );
$chart->set_bg_colour($config['bg_colour']);
if (!empty($homeSum) && !empty($awaySum)) {
if ($config['home_away_stats']) {
$bar1 = new $config['bartype_1']();
$bar1->set_values($homeSum);
$bar1->set_tooltip(JText::_('COM_JOOMLEAGUE_STATS_HOME') . ": #val#");
$bar1->set_colour($config['bar1']);
$bar1->set_on_show(new bar_on_show($config['animation_1'], $config['cascade_1'], $config['delay_1']));
$bar1->set_key(JText::_('COM_JOOMLEAGUE_STATS_HOME'), 12);
$bar2 = new $config['bartype_2']();
$bar2->set_values($awaySum);
$bar2->set_tooltip(JText::_('COM_JOOMLEAGUE_STATS_AWAY') . ": #val#");
$bar2->set_colour($config['bar2']);
$bar2->set_on_show(new bar_on_show($config['animation_2'], $config['cascade_2'], $config['delay_2']));
$bar2->set_key(JText::_('COM_JOOMLEAGUE_STATS_AWAY'), 12);
$chart->add_element($bar1);
$chart->add_element($bar2);
}
}
// total
$d = new $config['dotstyle_3']();
$d->size((int) $config['line3_dot_strength']);
$d->halo_size(1);
$d->colour($config['line3']);
$d->tooltip(JText::_('COM_JOOMLEAGUE_STATS_TOTAL2') . ' #val#');
$line = new line();
$line->set_default_dot_style($d);
$line->set_values($matchDayGoalsCount);
$line->set_width((int) $config['line3_strength']);
$line->set_key(JText::_('COM_JOOMLEAGUE_STATS_TOTAL'), 12);
$line->set_colour($config['line3']);
$line->on_show(new line_on_show($config['l_animation_3'], $config['l_cascade_3'], $config['l_delay_3']));
$chart->add_element($line);
$x = new x_axis();
$x->set_colours($config['x_axis_colour'], $config['x_axis_colour_inner']);
$x->set_labels_from_array($round_labels);
$chart->set_x_axis($x);
$x_legend = new x_legend(JText::_('COM_JOOMLEAGUE_STATS_ROUNDS'));
$x_legend->set_style('{font-size: 15px; color: #778877}');
$chart->set_x_legend($x_legend);
$y = new y_axis();
$y->set_range(0, @max($matchDayGoalsCount) + 2, 1);
$y->set_steps(round(@max($matchDayGoalsCount) / 8));
$y->set_colours($config['y_axis_colour'], $config['y_axis_colour_inner']);
$chart->set_y_axis($y);
$y_legend = new y_legend(JText::_('COM_JOOMLEAGUE_STATS_GOALS'));
$y_legend->set_style('{font-size: 15px; color: #778877}');
$chart->set_y_legend($y_legend);
$this->chartdata = $chart;
}
开发者ID:Heart1010,项目名称:JoomLeague,代码行数:78,代码来源:view.html.php
示例12: title
$tdf = 'd.m.y';
$title = new title('Processed MIMS ' . date($tdf, $time_lookback) . ' - ' . date($tdf));
$title->set_style('{color: #567300; font-size: 14px}');
$bar = new bar_filled('#2020AC', '#202073', 10);
$bar->set_values(array_values($x_values));
//BAR CHART
$xfs = 11;
//x fontsize
$yfs = 12;
//y fontsize
$hfs = 16;
//header fontsize
//create chart
$chart = new open_flash_chart();
$chart->set_title($title);
$chart->add_element($bar);
//x-label
$x = new x_axis();
$x->set_labels_from_array($x_labels);
$chart->set_x_axis($x);
//y-label
$y_points = 5;
$y_max = max($x_values);
$y_step = ceil($y_max / $y_points);
$y_max = $y_step * ($y_points + 1);
$y = new y_axis();
$y->set_range(0, $y_max, $y_step);
$chart->set_y_axis($y);
//draw data for chart
echo $chart->toString();
require_once 'confy_close.php';
开发者ID:blasiuscosa,项目名称:manobo-2008,代码行数:31,代码来源:kpi-mims-monthly.php
示例13: if
else if ($isConvertFtoC ) {
// apply temp F to C conversion
$y=convertFtoC($row["$name_alt"]);
}
else {
// no conversion, so use raw value
$y=$row["$name_alt"];
}
$data[] = new scatter_value($x, $y);
}
}
$s_alt->set_values( $data );
}
// Prepare the x-axis
$x = new x_axis();
$x->set_range( $ranges['min_date'], $ranges['max_date'] );
// Calculate the steps and visible steps
$step=($ranges['max_date'] - $ranges['min_date'])/60;
$step_vis=2;
// do not allow steps to be less than 1 day
if ($step < 86400) {
$step = 86400;
$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);
开发者ID:juggernautsei,项目名称:openemr,代码行数:31,代码来源:graphs.php
示例14: title
$type_idx = $_GET['i'];
$type_idx = $type_idx == 0 ? $type_idx : $type_idx - 1;
$title = new title("Individual Portfolio Performance (" . $portfolio_type[$type_idx] . ")");
$title->set_style("{font-size: 25px; font-family: Calibri; font-weight: bold; color: #121212; text-align: center;}");
$chart->set_title($title);
// y axis properties
$y = new y_axis();
$y_min = 0.0;
$y_max = 0.0;
$y_min = floor(0.995 * $amt_min);
$y_max = ceil(1.005 * $amt_max);
$y->set_grid_colour('#EFEFEF');
$y->set_range($y_min, $y_max, round(($y_max - $y_min) / 5.0));
$chart->set_y_axis($y);
// y legend properties
$y_legend = new y_legend('Amount ($)');
$y_legend->set_style('{font-size:15px; font-family:Calibri; color:#121212}');
$chart->set_y_legend($y_legend);
// x axis properties
$x = new x_axis();
$x->set_labels_from_array($x_labels);
$x->grid_colour('#EFEFEF');
$chart->set_x_axis($x);
// background properties
$chart->set_bg_colour('#FFFFFF');
// menu
$m = new ofc_menu("#E0E0FF", "#707070");
$m->values(array(new ofc_menu_item('Toggle view', 'toggle')));
//$chart->set_menu($m);
echo $chart->toPrettyString();
//echo $chart_data;
开发者ID:rb-ma,项目名称:myaarth,代码行数:31,代码来源:dataPortfolio.php
示例15: bar_filled
<?php
$this->output->set_header("Cache-Control: no-store, no-cache, must-revalidate");
$this->output->set_header("Pragma: public");
$bar = new bar_filled('#4386a1', '#577261');
$bar_labels = array();
$bar_values = array();
foreach ($data as $label => $value) {
$bar_labels[] = (string) $label;
$bar_values[] = (double) $value;
}
$bar->set_values($bar_values);
$chart = new open_flash_chart();
$chart->set_title(new title($title));
$x = new x_axis();
$x->steps(1);
$x->set_labels_from_array($bar_labels);
$chart->set_x_axis($x);
$y = new y_axis();
$y->set_tick_length(7);
$y->set_range(0, (count($data) > 0 ? max($data) : 0) + 25, ((count($data) > 0 ? max($data) : 0) + 25) / 10);
$chart->set_y_axis($y);
$chart->set_bg_colour("#f3f3f3");
$chart->add_element($bar);
if (isset($yaxis_label)) {
$y_legend = new y_legend($yaxis_label);
$y_legend->set_style('{font-size: 20px; color: #000000}');
$chart->set_y_legend($y_legend);
}
if (isset($xaxis_label)) {
$x_legend = new x_legend($xaxis_label);
开发者ID:jericmillena,项目名称:pos_cafe,代码行数:31,代码来源:bar.php
示例16: 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
示例17: sort
# // UNIX.time
sort($the_sort);
$lowest = $the_sort[0];
rsort($the_sort);
$highest = $the_sort[0];
// get maximum value (for y-axis)
$the_sort = $the_value_array;
foreach ($the_checked_cols as $col) {
rsort($the_sort[$col]);
$maxima[] = $the_sort[$col][0];
}
rsort($maxima);
$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);
开发者ID:minggLu,项目名称:openemr,代码行数:31,代码来源:graph_track_anything.php
示例18: RenderChart
protected function RenderChart($oPage, $sId, $aValues, $sDrillDown = '', $aRows = array())
{
// 1- Compute Open Flash Chart data
//
$aValueKeys = array();
$index = 0;
if (count($aValues) > 0 && $sDrillDown != '') {
$oFilter = DBObjectSearch::FromOQL($sDrillDown);
$sClass = $oFilter->GetClass();
$sOQLClause = str_replace('SELECT ' . $sClass, '', $sDrillDown);
$aSQLColNames = array_keys(current($aRows));
// Read the list of columns from the current (i.e. first) element of the array
$oAppContext = new ApplicationContext();
$sURL = utils::GetAbsoluteUrlAppRoot() . 'pages/UI.php?operation=search_oql&search_form=0&oql_class=' . $sClass . '&format=html&' . $oAppContext->GetForLink() . '&oql_clause=';
}
$aURLs = array();
foreach ($aValues as $key => $value) {
// Make sure that values are integers (so that max() will work....)
// and build an array of STRING with the keys (numeric keys are transformed into string by PHP :-(
$aValues[$key] = (int) $value;
$aValueKeys[] = (string) $key;
// Build the custom query for the 'drill down' on each element
if ($sDrillDown != '') {
$sFilter = $sOQLClause;
foreach ($aSQLColNames as $sColName) {
$sFilter = str_replace(':' . $sColName, "'" . addslashes($aRows[$key][$sColName]) . "'", $sFilter);
$aURLs[$index] = $sURL . urlencode($sFilter);
}
}
$index++;
}
$oChart = new open_flash_chart();
if ($this->m_sType == 'bars') {
$oChartElement = new bar_glass();
if (count($aValues) > 0) {
$maxValue = max($aValues);
} else {
$maxValue = 1;
}
$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);
$aBarValues = array();
foreach ($aValues as $iValue) {
$oBarValue = new bar_value($iValue);
$oBarValue->on_click("ofc_drilldown_{$sId}");
$aBarValues[] = $oBarValue;
}
$oChartElement->set_values($aBarValues);
//$oChartElement->set_values(array_values($aValues));
$oXAxis = new x_axis();
$oXLabels = new x_axis_labels();
// set them vertical
$oXLabels->set_vertical();
// set the label text
$oXLabels->set_labels($aValueKeys);
// Add the X Axis Labels to the X Axis
$oXAxis->set_labels($oXLabels);
$oChart->set_x_axis($oXAxis);
} else {
$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'));
$aData = array();
foreach ($aValues as $sValue => $iValue) {
$oPieValue = new pie_value($iValue, $sValue);
//@@ BUG: not passed via ajax !!!
$oPieValue->on_click("ofc_drilldown_{$sId}");
$aData[] = $oPieValue;
}
$oChartElement->set_values($aData);
$oChart->x_axis = null;
}
// Title given in HTML
//$oTitle = new title($this->m_sTitle);
//$oChart->set_title($oTitle);
$oChart->set_bg_colour('#FFFFFF');
$oChart->add_element($oChartElement);
$sData = $oChart->toPrettyString();
$sData = json_encode($sData);
// 2- Declare the Javascript function that will render the chart data\
//
$oPage->add_script(<<<EOF
function ofc_get_data_{$sId}()
{
\treturn {$sData};
//.........这里部分代码省略.........
开发者ID:leandroborgeseng,项目名称:bhtm,代码行数:101,代码来源:sqlblock.class.inc.php
|
请发表评论