Example #1
0
    echo slugify($title);
    ?>
"><?php 
    echo $title;
    ?>
</a></h1>

<div class="clear section">
<?php 
    foreach ($inner as $inner_title => $funnel) {
        $steps = array();
        $i++;
        $j = 0;
        foreach ($funnel['steps'] as $key => $step) {
            $tuple = array($j++);
            $g = new Graph_Graphlot($time);
            $g->addMetric($funnel['prefix'] . ".{$key}");
            $step_data = $g->getData(false);
            $tuple[] = Graph_Graphlot::sum($step_data[0]["data"]);
            $steps[] = $tuple;
        }
        $data = array(array("label" => $inner_title, 'data' => $steps));
        $data = json_encode($data);
        $ticks = Graph_Graphlot::zip(range(0, count($steps) - 1), array_values($funnel['steps']));
        $options = json_encode(array("xaxis" => array('ticks' => $ticks)));
        $slug = "";
        $slug = slugify($title) . '_' . slugify($inner_title);
        $container_id = "f-container-{$i}";
        $container_selector = "#{$container_id}";
        ?>
Example #2
0
    ?>
</a></h1>

    <div class="clear section">
    <?php 
    foreach ($inner as $index => $graph) {
        if (empty($graph)) {
            print '<div class="container"></div>';
            continue;
        }
        if ($index === 'description') {
            print "<p class=\"graph-description\">{$graph}</p>\n";
            continue;
        }
        $i += 1;
        $g = new Graph_Graphlot($time);
        if (isset($start_time)) {
            $g->from = $start_time;
        }
        if (isset($end_time)) {
            $g->until = $end_time;
        }
        $options = (object) array();
        foreach ($graph['metrics'] as $m) {
            call_user_func_array(array($g, 'addMetric'), $m);
            // $g->addMetric($m[0], $m[1]);
        }
        if (isset($graph['coarsen'])) {
            $g->coarsen($graph['coarsen']);
        }
        if (isset($graph['options']) && $graph['options']) {