예제 #1
0
 function createGraph($name, $type)
 {
     YDInclude('YDGraph.php');
     // generate chart
     $values = array();
     for ($i = 0; $i < 12; $i++) {
         $values[] = rand(20, 60);
     }
     $labels = array('Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec');
     // Create a new graph
     $g1 = new YDGraph(550, 250);
     $g1->setLimits(0, 20);
     $g1->setOffset(5);
     $g1->setFormat(1, ',', '.');
     $g1->addSeries($values, $type, 'Series1', SOLID, '#444444', '#4682B4');
     $g1->setYAxis('#4682B4', SOLID, 5, 'example');
     $g1->setLabels($labels, '#000000', 1, HORIZONTAL);
     $g1->plot(dirname(__FILE__) . '/' . $name);
 }
예제 #2
0
 function actionDemo12()
 {
     $ochart = new YDGraph(300, 130, 7, '#bbeebb');
     $ochart->setTitle("Impuls, line & dot", "#004400", 2);
     $ochart->setPlotArea(SOLID, "#888888", '#bbbbbb');
     $ochart->setLimits(0, 70, 10);
     $ochart->addSeries($this->vCht4, 'impuls', 'Series1', SOLID, '#000000', '#ffff00');
     $ochart->addSeries($this->vCht4, 'line', 'Series2', SOLID, '#ff0000', '#ffff00');
     $ochart->addSeries($this->vCht4, 'dot', 'Series3', SOLID, '#ff0000', '#ffff00');
     $ochart->setXAxis('#006600', MEDIUM_SOLID, 1, "", '%s');
     $ochart->setYAxis('#006600', SOLID, 5, "Y Axis", '%d');
     $ochart->setLabels($this->vLabels, '#000000', 1, HORIZONTAL);
     $ochart->plot();
 }