当前位置: 首页>>代码示例>>PHP>>正文


PHP x_axis::steps方法代码示例

本文整理汇总了PHP中x_axis::steps方法的典型用法代码示例。如果您正苦于以下问题:PHP x_axis::steps方法的具体用法?PHP x_axis::steps怎么用?PHP x_axis::steps使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在x_axis的用法示例。


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

示例1: elseif

        $data_step = $data_step_multiplier / 2;
    } elseif ($data_max > $data_step_multiplier) {
        $data_step = $data_step_multiplier / 5;
    } else {
        $data_step = $data_step_multiplier / 10;
    }
}
$data_max = ceil($data_max / $data_step) * $data_step;
//DRAW X AXIS
$x = new x_axis();
$x->set_offset(false);
$xl_tmp = array();
foreach ($dates as $date) {
    $xl_tmp[] = date('d.m', strtotime($date));
}
$x->steps(10);
$x->set_labels_from_array($xl_tmp);
//DRAW Y AXIS
$y = new y_axis();
$y->set_offset(false);
$y->set_range(0, $data_max, $data_step);
//SET TOOLTIP FORMAT
$t = new tooltip();
$t->set_shadow(false);
$t->set_stroke(5);
$t->set_colour("#cccccc");
$t->set_background_colour("#efefef");
$t->set_body_style("{font-size:10px; font-weight:bold; color:#000000;}");
//PREPARE FINAL CHART AND RETURN IT
$chart = new open_flash_chart();
$chart->set_title($title);
开发者ID:blasiuscosa,项目名称:manobo-2008,代码行数:31,代码来源:analysis-depot-stock.php

示例2: array

$line_data = array();
$labels = array();
foreach ($data as $label => $value) {
    $line_data[] = (double) $value;
    $labels[] = (string) $label;
}
$hol = new hollow_dot();
$hol->size(3)->halo_size(1)->tooltip('#x_label#<br>#val#');
$line = new line();
$line->set_default_dot_style($hol);
$line->set_values($line_data);
$chart = new open_flash_chart();
$chart->set_title(new title($title));
$chart->add_element($line);
$x = new x_axis();
$x->steps(count($data) > 10 ? (int) (count($data) / 4) : 1);
$x->set_labels_from_array($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");
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);
    $x_legend->set_style('{font-size: 20px; color: #000000}');
开发者ID:MaizerGomes,项目名称:opensourcepos,代码行数:31,代码来源:line.php

示例3: array

<?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

示例4: elseif

        $data_step = $data_step_multiplier / 2;
    } elseif ($data_max > $data_step_multiplier) {
        $data_step = $data_step_multiplier / 5;
    } else {
        $data_step = $data_step_multiplier / 10;
    }
}
$data_max = ceil($data_max / $data_step) * $data_step;
//DRAW X AXIS
$x = new x_axis();
$x->set_offset(false);
$xl_tmp = array();
for ($kw = 1; $kw <= 52; $kw++) {
    $xl_tmp[] = "KW {$kw}";
}
$x->steps(3);
$x->set_labels_from_array($xl_tmp);
//DRAW Y AXIS
$y = new y_axis();
$y->set_offset(false);
$y->set_range(0, $data_max, $data_step);
//SET TOOLTIP FORMAT
$t = new tooltip();
$t->set_shadow(false);
$t->set_stroke(5);
$t->set_colour("#cccccc");
$t->set_background_colour("#efefef");
$t->set_body_style("{font-size:10px; font-weight:bold; color:#000000;}");
if ($year == $year_today) {
    //MARK TODAY KW
    $today = new shape('#b266b2');
开发者ID:blasiuscosa,项目名称:manobo-2008,代码行数:31,代码来源:calendar-week.php


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