setAntiAliasing(TRUE); $graph->title->set("Some lines"); $group = new PlotGroup; $group->setXAxisZero(FALSE); $group->setBackgroundColor(new Color(197, 180, 210, 80)); $group->setPadding(40, NULL, 50, NULL); $group->axis->left->setLabelNumber(8); $group->axis->left->setLabelPrecision(1); $group->axis->left->setTickStyle(Tick::OUT); $group->axis->bottom->setTickStyle(Tick::OUT); // Display two lines for($n = 0; $n < 2; $n++) { $x = array(); for($i = 0; $i < 10; $i++) { $x[] = (cos($i * M_PI / 5)) / ($n + 1); } $plot = new LinePlot($x); $plot->setColor(color(10)); // Random line color $plot->setFillColor(color(90)); // Random background color $plot->label->set($x); $plot->label->setBackgroundColor(new Color(220, 234, 230, 25)); $plot->label->setPadding(1, 0, 0, 0); $plot->label->setCallbackFunction("formatLabel"); $plot->label->setInterval(2); $group->add($plot); $group->legend->add($plot, "Line #".($n + 1), Legend::LINE); } $group->legend->setSpace(12); $group->legend->setBackgroundColor(new Color(255, 255, 255)); $group->setPadding(NULL, 100, NULL, NULL); $graph->add($group); $graph->draw(); ?>