Subversion Repositories cheapmusic

Rev

Blame | Last modification | View Log | RSS feed

<?xml version="1.0" encoding="ISO-8859-1" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" /><title>5.9. Example - Pie Chart, text-data</title><link rel="stylesheet" type="text/css" href="phplotdoc.css" /><meta name="generator" content="DocBook XSL Stylesheets V1.78.1" /><link rel="home" href="index.html" title="PHPlot Reference Manual" /><link rel="up" href="examples.html" title="Chapter 5. PHPlot Examples" /><link rel="prev" href="ex-pie1.html" title="5.8. Example - Pie Chart, text-data-single" /><link rel="next" href="ex-pie3.html" title="5.10. Example - Pie Chart, flat with options" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">5.9. Example - Pie Chart, text-data</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="ex-pie1.html">Prev</a> </td><th width="60%" align="center">Chapter 5. PHPlot Examples</th><td width="20%" align="right"> <a accesskey="n" href="ex-pie3.html">Next</a></td></tr></table><hr /></div><div class="sect1"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="ex-pie2"></a>5.9. Example - Pie Chart, text-data</h2></div></div></div><p>
This is a simple pie chart showing the data type 'text-data'.
When you use this data type with pie charts, the first entry in each record
(a label) is ignored; the sum of all the second entries equals the relative
size of the first segment, the sum of the third entries is the second segment,
etc. So this pie has 4 segments, of relative size 250, 200, 350, and 200.
</p><p>
Data type 'data-data' is similar, except the first two entries in each
record (label and X value for other plot types) is ignored.
</p><div class="example"><a id="example-pie2"></a><p class="title"><strong>Example 5.9. Pie Chart, text-data</strong></p><div class="example-contents"><div class="informalfigure"><div class="mediaobject"><img src="examples/pie2.png" alt="Pie Chart text-data Example" /></div></div><pre class="programlisting">&lt;?php
# PHPlot Example: Pie/text-data
require_once 'phplot.php';

$data = array(
  array('', 100, 100, 200, 100),
  array('', 150, 100, 150, 100),
);

$plot = new PHPlot(800,600);
$plot-&gt;SetImageBorderType('plain');
$plot-&gt;SetDataType('text-data');
$plot-&gt;SetDataValues($data);
$plot-&gt;SetPlotType('pie');
$plot-&gt;DrawGraph();
</pre></div></div><br class="example-break" /></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="ex-pie1.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="examples.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="ex-pie3.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">5.8. Example - Pie Chart, text-data-single </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> 5.10. Example - Pie Chart, flat with options</td></tr></table></div></body></html>