Libchart

Simple PHP chart drawing library
  • Introduction
  • Download
  • Sample Code
  • Reference API
  • Links

Pie chart sample

Pie chart sample

Source Code

<?php
	include "libchart/classes/libchart.php";

	header("Content-type: image/png");

	$chart = new PieChart(500, 260);

	$dataSet = new XYDataSet();
	$dataSet->addPoint(new Point("Mozilla Firefox (80)", 80));
	$dataSet->addPoint(new Point("Konqueror (75)", 75));
	$dataSet->addPoint(new Point("Other (50)", 50));
	$chart->setDataSet($dataSet);

	$chart->setTitle("User agents for www.example.com");
	$chart->render();
?>
		

Back


Site last modified July 27th, 2011 by Jean-Marc Trémeaux