error_reporting(0); header("Content-type: image/png"); require_once LIBRARIES . "libchart" . PATH_SEP . "libchart.php"; if ($REQUEST['type'] == "pie") { $chart = new PieChart($width, $height); } elseif ($REQUEST['type'] == "hbar") { $chart = new HorizontalChart($width, $height); } elseif ($REQUEST['type'] == "vbar") { $chart = new VerticalChart($width, $height); $chart->setLabelMarginBottom(100); } else { $chart = new LineChart($width, $height); $chart->setLabelMarginBottom(150); } foreach ($REQUEST['datas'] as $data) { $chart->addPoint(new Point($data[0], $data[1])); } $chart->setLogo(""); $chart->setTitle($REQUEST['title']); $chart->render(); $BL->Disconnect(); } //GET INVOICE/SALES/SERVERLOAD REPORT if ($cmd == "load") { include_once XMLFEEDS . "uptime.php"; } if ($cmd == "cbm") { include_once XMLFEEDS . "orders_monthly.php"; } if ($cmd == "inv") { include_once XMLFEEDS . "invoices_all.php";
* but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * */ /** * Line demonstration * */ include "../libchart.php"; $chart = new LineChart(); $chart->addPoint(new Point("06-01", 273)); $chart->addPoint(new Point("06-02", 421)); $chart->addPoint(new Point("06-03", 642)); $chart->addPoint(new Point("06-04", 799)); $chart->addPoint(new Point("06-05", 1009)); $chart->addPoint(new Point("06-06", 1406)); $chart->addPoint(new Point("06-07", 1820)); $chart->addPoint(new Point("06-08", 2511)); $chart->addPoint(new Point("06-09", 2832)); $chart->addPoint(new Point("06-10", 3550)); $chart->addPoint(new Point("06-11", 4143)); $chart->addPoint(new Point("06-12", 4715)); $chart->setTitle("Sales for 2006"); $chart->render("generated/demo5.png"); ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">