コード例 #1
0
ファイル: chart-data_multi.php プロジェクト: jphcoi/veille
        $xlab_an[] = $i;
        if (array_key_exists($i, $data)) {
            $data_propre[$i] = $data[$i] + $j / 45;
        } else {
            $data_propre[$i] = 0 + $j / 45;
        }
    }
    //print_r($data_propre);
    //$g->set_data( $data_propre );
    echo '<br>' . 'couleur' . $colors[$j] . '<br>';
    $data_1 = new line(2, $colors[$j]);
    $data_1->key($label, 10);
    for ($i = $periodes['from']; $i <= $periodes['to']; $i += 1) {
        echo $i . '<br>';
        echo '<br>(' . $label . ': Billets: ' . $data_propre[$i] . ')' . '<br>';
        $data_1->add_data_tip($data_propre[$i], '(' . $label . ': Billets: ' . intval($data_propre[$i]) . ')');
    }
    $g->data_sets[] = $data_1;
    $max_data = max(5, max(intval(ceil(max($data_propre) * 1.1) / $steps_nb) * $steps_nb, $max_data));
    echo $max_data;
}
print_r($g);
echo '<br>on a envoye toutes les donnees<br>';
if ($racine == 'veille') {
    $xlab = array('', '', '', '21/09', '', '', '', '', '', '', '28/09', '', '', '', '', '', '', '5/10', '', '', '', '', '', '', '12/10', '', '', '', '', '', '', '19/10', '', '', '', '', '', '', '26/10', '', '', '', '', '', '', '2/11', '', '', '', '', '', '', '9/11', '', '', '', '', '', '', '16/11', '', '', '', '', '', '', '23/11', '', '', '', '', '', '', '30/11', '', '', '', '', '', '', '7/12', '', '', '', '', '', '', '14/12', '', '');
} elseif ($racine == 'biofuel') {
    $xlab = array('1991', '1992', '1993', '1994', '1995', '1996', '1997', '1998', '1999', '2000', '2001', '2002', '2003', '2004', '2005', '2006', '2007', '2008', '2009', '2010');
} elseif ($racine == 'biodiv') {
    $xlab = array('1992', '1993', '1994', '1995', '1996', '1997', '1998', '1999', '2000', '2001', '2002', '2003', '2004', '2005', '2006', '2007', '2008', '2009');
}
echo '<br>';
コード例 #2
0
ファイル: chart-data.php プロジェクト: jphcoi/veille
    }
}
$data_propre_old = $data_propre;
//lissage sur 3 jours
$data_propre = array();
$data_propre = $data_propre_old;
echo '<br>';
print_r($data_propre);
echo '<br>';
include_once '../php-ofc-library/open-flash-chart.php';
$g = new graph();
//$g->set_data( $data_propre );
$data_1 = new line(2, '#9933CC');
$data_1->key('Nombre d\'occurrences brutes', 10);
for ($i = $dated; $i < $datef + 1; $i += 1) {
    $data_1->add_data_tip($data_propre[$i], '(Billets: ' . $data_propre[$i] . ')');
}
$g->data_sets[] = $data_1;
$g->set_x_axis_steps(1);
$g->set_x_label_style(10, '#9933CC', 0, 1, '#00A000');
if ($racine == 'veille') {
    $g->set_x_labels(array('', '', '', '21/09', '', '', '', '', '', '', '28/09', '', '', '', '', '', '', '5/10', '', '', '', '', '', '', '12/10', '', '', '', '', '', '', '19/10', '', '', '', '', '', '', '26/10', '', '', '', '', '', '', '2/11', '', '', '', '', '', '', '9/11', '', '', '', '', '', '', '16/11', '', '', '', '', '', '', '23/11', '', '', '', '', '', '', '30/11', '', '', '', '', '', '', '7/12', '', '', '', '', '', '', '14/12', '', ''));
} elseif ($racine == 'biofuel') {
    $g->set_x_labels(array('1991', '1992', '1993', '1994', '1995', '1996', '1997', '1998', '1999', '2000', '2001', '2002', '2003', '2004', '2005', '2006', '2007', '2008', '2009', '2010'));
} elseif ($racine == 'biodiv') {
    $g->set_x_labels(array('1992', '1993', '1994', '1995', '1996', '1997', '1998', '1999', '2000', '2001', '2002', '2003', '2004', '2005', '2006', '2007', '2008', '2009'));
} else {
    $g->set_x_labels($xlab);
}
if ($type_date = 'annee') {
    $g->set_x_labels($xlab_an);