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


PHP open_flash_chart类代码示例

本文整理汇总了PHP中open_flash_chart的典型用法代码示例。如果您正苦于以下问题:PHP open_flash_chart类的具体用法?PHP open_flash_chart怎么用?PHP open_flash_chart使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: 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

示例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: 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

示例4: build

 function build($options = array())
 {
     if (empty($options)) {
         return false;
     }
     require_once WWW_ROOT . 'php-ofc-library/open-flash-chart.php';
     $chart = new open_flash_chart();
     if (isset($options['title']['txt'])) {
         $title = new title($options['title']['txt']);
         if (isset($options['title']['style'])) {
             $title->set_style("{" . $options['title']['style'] . "}");
         }
         $chart->set_title($title);
     }
     if (isset($options['chart']['bg'])) {
         $chart->set_bg_colour($options['chart']['bg']);
     }
     if (isset($xOptions['color'])) {
         $x->colour($xOptions['color']);
     }
     if (isset($xOptions['grid_colour'])) {
         $x->grid_colour($xOptions['grid_colour']);
     }
     $col = isset($options['color']) ? $options['color'] : null;
     $outlineCol = isset($options['outline_col']) ? $options['outline_col'] : null;
     if (isset($options['charts'])) {
         foreach ($options['charts'] as $chartOpts) {
             $type = isset($chartOpts['type']) ? $chartOpts['type'] : 'bar_filled';
             $diagram = new $type($chartOpts['col'], $chartOpts['outline']);
             if ($type == 'bar_3d') {
                 $diagram->colour = $col;
             }
             $diagram->set_values($chartOpts['values']);
             if (isset($chartOpts['key'])) {
                 $diagram->key($chartOpts['key'], 12);
             }
             $xAxis = $this->xAxis($options);
             if ($xAxis !== null) {
                 $chart->set_x_axis($xAxis);
             }
             $yAxis = $this->yAxis($options);
             if ($xAxis !== null) {
                 $chart->set_y_axis($yAxis);
             }
             if (isset($chartOpts['tooltip'])) {
                 $diagram->set_tooltip($chartOpts['tooltip']);
             }
             $chart->add_element($diagram);
         }
     }
     return $chart->toPrettyString();
 }
开发者ID:stripthis,项目名称:donate,代码行数:52,代码来源:open_flash_chart.php

示例5: max

    $line_tot->set_width(2);
    $line_tot->set_key('Gesamt (kWh)', 10);
    $line_tot->set_tooltip("#val# kWh");
    $max = max(max($data_watt), $max_val) * 1.15;
    $y = new y_axis();
    $y->set_range(0, $max, round($max * 0.1, -1));
    $x_labels = new x_axis_labels();
    $x_labels->set_vertical();
    $x_labels->set_steps(6);
    $x_labels->set_colour('#333333');
    $x_labels->set_labels($time_axis);
    $x = new x_axis();
    $x->set_colour('#333333');
    $x->set_grid_colour('#ffffff');
    $x->set_offset(false);
    $x->set_steps(3);
    // Add the X Axis Labels to the X Axis
    $x->set_labels($x_labels);
    $chart = new open_flash_chart();
    $chart->set_tooltip($tooltip);
    $chart->set_title($title);
    //$chart->add_element( $line_max );
    $chart->add_element($line_watt);
    $chart->add_element($bars_curr);
    //$chart->add_element( $line_tot );
    //$chart->add_element( $sline );
    $chart->set_bg_colour('#ffffff');
    $chart->set_y_axis($y);
    $chart->set_x_axis($x);
    echo $chart->toString();
}
开发者ID:ragchuck,项目名称:pv,代码行数:31,代码来源:solardata_day.php

示例6: title

$this->output->set_header("Cache-Control: no-store, no-cache, must-revalidate");
$this->output->set_header("Pragma: public");
$title = new title($title);
$hbar = new hbar('#86BBEF');
$hbar->set_tooltip($this->lang->line('reports_revenue') . ': #val#');
$y_labels = array();
$max_value = 0;
foreach ($data as $label => $value) {
    if ($max_value < $value) {
        $max_value = $value;
    }
    $y_labels[] = (string) $label;
    $hbar->append_value(new hbar_value(0, (double) $value));
}
$chart = new open_flash_chart();
$chart->set_title($title);
$chart->add_element($hbar);
$step_count = $max_value > 0 ? $max_value / 10 : 1;
$x = new x_axis();
$x->set_offset(false);
$x->set_steps($max_value / 10);
$chart->set_x_axis($x);
$y = new y_axis();
$y->set_offset(true);
$y->set_labels($y_labels);
$chart->add_y_axis($y);
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);
开发者ID:nguyennamtien,项目名称:PHP-Point-Of-Sale,代码行数:30,代码来源:hbar.php

示例7: GetRenderContent


//.........这里部分代码省略.........
                    $sHtml .= "<p>";
                    $sHtml .= htmlentities(Dict::S('UI:CSVExport:AdvancedMode+'), ENT_QUOTES, 'UTF-8');
                    $sHtml .= "</p>";
                }
                $sHtml .= "</div>";
                $sHtml .= "<div id=\"csv_content_loading\"><div style=\"width: 250px; height: 20px; background: url(../setup/orange-progress.gif); border: 1px #999 solid; margin-left:auto; margin-right: auto; text-align: center;\">" . Dict::S('UI:Loading') . "</div></div><textarea id=\"csv_content\" style=\"display:none;\">\n";
                //$sHtml .= htmlentities($sCSVData, ENT_QUOTES, 'UTF-8');
                $sHtml .= "</textarea>\n";
                $oPage->add_ready_script("\$.post('{$sAjaxLink}', {}, function(data) { \$('#csv_content').html(data); \$('#csv_content_loading').hide(); \$('#csv_content').show();} );");
                break;
            case 'modify':
                if (UserRights::IsActionAllowed($this->m_oSet->GetClass(), UR_ACTION_MODIFY, $this->m_oSet) == UR_ALLOWED_YES) {
                    while ($oObj = $this->m_oSet->Fetch()) {
                        $sHtml .= $oObj->GetModifyForm($oPage);
                    }
                }
                break;
            case 'search':
                $sStyle = isset($aExtraParams['open']) && $aExtraParams['open'] == 'true' ? 'SearchDrawer' : 'SearchDrawer DrawerClosed';
                $sHtml .= "<div id=\"ds_{$sId}\" class=\"{$sStyle}\">\n";
                $oPage->add_ready_script(<<<EOF
\t\$("#dh_{$sId}").click( function() {
\t\t\$("#ds_{$sId}").slideToggle('normal', function() { \$("#ds_{$sId}").parent().resize(); FixSearchFormsDisposition(); } );
\t\t\$("#dh_{$sId}").toggleClass('open');
\t});
EOF
);
                $aExtraParams['currentId'] = $sId;
                $sHtml .= cmdbAbstractObject::GetSearchForm($oPage, $this->m_oSet, $aExtraParams);
                $sHtml .= "</div>\n";
                $sHtml .= "<div class=\"HRDrawer\"></div>\n";
                $sHtml .= "<div id=\"dh_{$sId}\" class=\"DrawerHandle\">" . Dict::S('UI:SearchToggle') . "</div>\n";
                break;
            case 'open_flash_chart':
                static $iChartCounter = 0;
                $oAppContext = new ApplicationContext();
                $sContext = $oAppContext->GetForLink();
                if (!empty($sContext)) {
                    $sContext = '&' . $sContext;
                }
                $sChartType = isset($aExtraParams['chart_type']) ? $aExtraParams['chart_type'] : 'pie';
                $sTitle = isset($aExtraParams['chart_title']) ? $aExtraParams['chart_title'] : '';
                $sGroupBy = isset($aExtraParams['group_by']) ? $aExtraParams['group_by'] : '';
                $sGroupByExpr = isset($aExtraParams['group_by_expr']) ? '&params[group_by_expr]=' . $aExtraParams['group_by_expr'] : '';
                $sFilter = $this->m_oFilter->serialize();
                $sHtml .= "<div id=\"my_chart_{$sId}{$iChartCounter}\">If the chart does not display, <a href=\"http://get.adobe.com/flash/\" target=\"_blank\">install Flash</a></div>\n";
                $oPage->add_script("function ofc_resize(left, width, top, height) { /* do nothing special */ }");
                if (isset($aExtraParams['group_by_label'])) {
                    $sUrl = urlencode(utils::GetAbsoluteUrlAppRoot() . "pages/ajax.render.php?operation=open_flash_chart&params[group_by]={$sGroupBy}{$sGroupByExpr}&params[group_by_label]={$aExtraParams['group_by_label']}&params[chart_type]={$sChartType}&params[chart_title]={$sTitle}&params[currentId]={$sId}&id={$sId}&filter=" . urlencode($sFilter));
                } else {
                    $sUrl = urlencode(utils::GetAbsoluteUrlAppRoot() . "pages/ajax.render.php?operation=open_flash_chart&params[group_by]={$sGroupBy}{$sGroupByExpr}&params[chart_type]={$sChartType}&params[chart_title]={$sTitle}&params[currentId]={$sId}&id={$sId}&filter=" . urlencode($sFilter));
                }
                $oPage->add_ready_script("swfobject.embedSWF(\"../images/open-flash-chart.swf\", \"my_chart_{$sId}{$iChartCounter}\", \"100%\", \"300\",\"9.0.0\", \"expressInstall.swf\",\n\t\t\t\t{\"data-file\":\"" . $sUrl . "\"}, {wmode: 'transparent'} );\n");
                $iChartCounter++;
                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;
开发者ID:henryavila,项目名称:itop,代码行数:67,代码来源:displayblock.class.inc.php

示例8: pie_value

            break;
    }
    $tmp = new pie_value($pie_value, $title);
    $tmp->set_colour($col);
    $d[] = $tmp;
    $ii++;
}
$pie = new pie();
$pie->set_start_angle(5);
$pie->set_animate(true);
$pie->set_label_colour('#432BAF');
$pie->set_gradient_fill();
switch ($action_value) {
    case "recordNum":
        $pie->set_tooltip('#label#<br>#val# (#percent#)');
        break;
    case "seconds":
        $pie->set_tooltip('#label#<br>#val# (#percent#)');
        break;
    default:
        $pie->set_tooltip('#label#<br>$#val# (#percent#)');
        break;
}
$pie->set_colours(array('#1F8FA1', '#848484', '#CACFBE', '#ffcc00', '#ffcc99', '#ffccff', '#99ccff', '#DEF799', '#FF33C9', '#FF653F', '#669900', '#ffcc00', '#ffcc99', '#ffccff', '#99ccff', '#1F8FA1', '#848484', '#CACFBE', '#ffcc00', '#ffcc99', '#ffccff', '#99ccff', '#DEF799', '#FF33C9', '#FF653F', '#669900', '#ffcc00', '#ffcc99', '#ffccff', '#99ccff'));
$pie->set_no_labels();
$pie->set_values($d);
$title = new title($title_val);
$chart = new open_flash_chart();
$chart->set_title($title);
$chart->add_element($pie);
echo $chart->toPrettyString();
开发者ID:ljhcj,项目名称:IRISCC,代码行数:31,代码来源:checkout.server.piegroup.php

示例9: 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

示例10: srand

<?php

require_once 'php-ofc-library/open-flash-chart.php';
// generate some random data
srand((double) microtime() * 1000000);
$max = 20;
$tmp = array();
for ($i = 0; $i < 13; $i++) {
    $tmp[] = rand(0, $max);
}
$title = new title(date("D M d Y"));
$bar = new bar();
$bar->set_values(array(3, 2, 3, 4, 5, 6, 7, 8, 9, 3, 12, 4));
$chart = new open_flash_chart();
$chart->set_title($title);
$chart->add_element($bar);
$path = "data.json.inc";
$file = fopen($path, "w");
fwrite($file, $chart->toString());
fclose($file);
开发者ID:shimion,项目名称:bluesnap,代码行数:20,代码来源:json.php

示例11: array

$brval[]=620;
$brval[]=350;
$brval[]=470;
$brval[]=134;
$brval[]=267;
$brval[]=534;
*/
$tmp = 0;
$d = array();
for ($i = 0; $i < $ii; $i++) {
    $tmp = new pie_value(intval($brval[$i]), "");
    //
    // this slice would normally be light green
    // but we are overriding the colour here:
    //
    //$tmp->set_colour( '#'.$i.'F'.$i.'3C'.$i );
    $tmp->set_label($br[$i], '#BFFF00', 10);
    $d[] = $tmp;
    //
    // here the colour cycle wraps and this gets the
    // first colour:
    //
}
$pie = new pie();
$pie->start_angle(35)->add_animation(new pie_fade())->add_animation(new pie_bounce(4))->gradient_fill()->tooltip('#val# of #total#<br>#percent# of 100%')->colours(array('#B8001F', '#4400A4', '#CD6600', '#E6FE00', '#007ED5', '#54E300'));
$pie->set_values($d);
$chart = new open_flash_chart();
$chart->set_title($title);
$chart->add_element($pie);
$chart->set_bg_colour('#AB4800');
echo $chart->toPrettyString();
开发者ID:Niladri123456,项目名称:Tutorial,代码行数:31,代码来源:os.php

示例12: renderHTML


//.........这里部分代码省略.........
            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();
        $mt_x_labels->rotate(20);
        $mt_bar = new bar_glass();
        $chart_vals = array();
        $chart_lbls = array();
        $i = 0;
        $ymax = 10;
        foreach ($ul_methods 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;
            }
        }
        $mt_bar->set_values($chart_vals);
        $mt_x_labels->set_labels($chart_lbls);
        $x = new x_axis();
        $x->set_labels($mt_x_labels);
        $y = new y_axis();
        $y->set_range(0, $ymax, $ymax / 10);
        $mt_chart = new open_flash_chart();
开发者ID:que273,项目名称:siremis,代码行数:67,代码来源:ChartsStatsUlsForm.php

示例13: hollow_dot

                        return 20;
                    } else {
                        return 5;
                    }
                }
            }
        }
    }
    // end function getIdeal...
}
// end if function_exist
// Prepare look and feel of data points
$def = new hollow_dot();
$def->size(4)->halo_size(3)->tooltip('#val#<br>#date:Y-m-d H:i#');
// Build and show the chart
$chart = new open_flash_chart();
$chart->set_title(new Title($titleGraph));
// do this for each checked data-column
//-----------------------------------
//#############################################################
foreach ($the_checked_cols as $col) {
    // reset loop-arrays
    $the_values = array();
    $the_dates = array();
    $the_data = array();
    // skip NULL or not-numeric entries
    // check if values are numeric
    // and change date into UNIX-format
    for ($i = 0; $i < $laenge; $i++) {
        if (is_numeric($the_value_array[$col][$i])) {
            // is numeric
开发者ID:minggLu,项目名称:openemr,代码行数:31,代码来源:graph_track_anything.php

示例14: array

 /**
  * Build The 3-D Bar Gharph.
  *
  * @param  array  $params  assoc array of name/value pairs          
  *
  * @return object $chart   object of open flash chart.
  * @static
  */
 static function &bar_3dChart(&$params)
 {
     $chart = null;
     if (empty($params)) {
         return $chart;
     }
     // $params['values'] should contains the values for each
     // criteria defined in $params['criteria']
     $values = CRM_Utils_Array::value('values', $params);
     $criterias = CRM_Utils_Array::value('criteria', $params);
     if (!is_array($values) || empty($values) || !is_array($criterias) || empty($criterias)) {
         return $chart;
     }
     // get the required data.
     $xReferences = $xValueLabels = $xValues = $yValues = array();
     foreach ($values as $xVal => $yVal) {
         if (!is_array($yVal) || empty($yVal)) {
             continue;
         }
         $xValueLabels[] = (string) $xVal;
         foreach ($criterias as $criteria) {
             $xReferences[$criteria][$xVal] = (double) CRM_Utils_Array::value($criteria, $yVal, 0);
             $yValues[] = (double) CRM_Utils_Array::value($criteria, $yVal, 0);
         }
     }
     if (empty($xReferences)) {
         return $chart;
     }
     // get the currency.
     require_once 'CRM/Utils/Money.php';
     $config = CRM_Core_Config::singleton();
     $symbol = $config->defaultCurrencySymbol;
     // set the tooltip.
     $tooltip = CRM_Utils_Array::value('tip', $params, "{$symbol} #val#");
     $count = 0;
     foreach ($xReferences as $criteria => $values) {
         $toolTipVal = $tooltip;
         // for seperate tooltip for each criteria
         if (is_array($tooltip)) {
             $toolTipVal = CRM_Utils_Array::value($criteria, $tooltip, "{$symbol} #val#");
         }
         // create bar_3d object
         $xValues[$count] = new bar_3d();
         // set colour pattel
         $xValues[$count]->set_colour(self::$_colours[$count]);
         // define colur pattel with bar criterias
         $xValues[$count]->key((string) $criteria, 12);
         // define bar chart values
         $xValues[$count]->set_values(array_values($values));
         // set tooltip
         $xValues[$count]->set_tooltip($toolTipVal);
         $count++;
     }
     $chartTitle = CRM_Utils_Array::value('legend', $params) ? $params['legend'] : ts('Bar Chart');
     //set y axis parameters.
     $yMin = 0;
     // calculate max scale for graph.
     $yMax = ceil(max($yValues));
     if ($mod = $yMax % str_pad(5, strlen($yMax) - 1, 0)) {
         $yMax += str_pad(5, strlen($yMax) - 1, 0) - $mod;
     }
     // if max value of y-axis <= 0, then set default values
     if ($yMax <= 0) {
         $ySteps = 1;
         $yMax = 5;
     } else {
         $ySteps = $yMax / 5;
     }
     // create x axis label obj.
     $xLabels = new x_axis_labels();
     $xLabels->set_labels($xValueLabels);
     // set angle for labels.
     if ($xLabelAngle = CRM_Utils_Array::value('xLabelAngle', $params)) {
         $xLabels->rotate($xLabelAngle);
     }
     // create x axis obj.
     $xAxis = new x_axis();
     $xAxis->set_labels($xLabels);
     //create y axis and set range.
     $yAxis = new y_axis();
     $yAxis->set_range($yMin, $yMax, $ySteps);
     // create chart title obj.
     $title = new title($chartTitle);
     // create chart.
     $chart = new open_flash_chart();
     // add x axis w/ labels to chart.
     $chart->set_x_axis($xAxis);
     // add y axis values to chart.
     $chart->add_y_axis($yAxis);
     // set title to chart.
     $chart->set_title($title);
     foreach ($xValues as $bar) {
//.........这里部分代码省略.........
开发者ID:hampelm,项目名称:Ginsberg-CiviDemo,代码行数:101,代码来源:OpenFlashChart.php

示例15: _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


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