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.17. Example - Thin Bar Line Plot, Wider Lines</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-thinbarline1.html" title="5.16. Example - Thin Bar Line Plot" /><link rel="next" href="ex-twoplot1.html" title="5.18. Example - Two Plots on One Image" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">5.17. Example - Thin Bar Line Plot, Wider Lines</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="ex-thinbarline1.html">Prev</a> </t
d><th width="60%" align="center">Chapter 5. PHPlot Examples</th><td width="20%" align="right"> <a accesskey="n" href="ex-twoplot1.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-thinbarline2"></a>5.17. Example - Thin Bar Line Plot, Wider Lines</h2></div></div></div><p>
This is the same as the previous plot type
(<a class="xref" href="ex-thinbarline1.html#example-thinbarline1" title="Example 5.16. Thin Bar Line">Example 5.16, “Thin Bar Line”</a>) except the lines are wider.
This now looks more like a bar chart.
</p><div class="example"><a id="example-thinbarline2"></a><p class="title"><strong>Example 5.17. Thin Bar Line Plot, Wider Lines</strong></p><div class="example-contents"><div class="informalfigure"><div class="mediaobject"><img src="examples/thinbarline2.png" alt="Wider Thin Bar Line Plot Example" /></div></div><pre class="programlisting"><?php
# PHPlot Example: thinbarline plot, wider
require_once 'phplot.php';
# To get repeatable results with 'random' data:
mt_srand(1);
# Make some noisy data:
$data = array();
for ($i = 0; $i < 100; $i++)
$data[] = array('', $i / 4.0 + 2.0 + mt_rand(-20, 20) / 10.0);
$plot = new PHPlot(800, 600);
$plot->SetImageBorderType('plain');
$plot->SetPlotType('thinbarline');
$plot->SetDataType('text-data');
$plot->SetDataValues($data);
# Main plot title:
$plot->SetTitle('Noisy Data (thinbarline, wider)');
# Make the lines wider:
$plot->SetLineWidths(3);
$plot->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-thinbarline1.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-twoplot1.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">5.16. Example - Thin Bar Line Plot </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> 5.18. Example - Two Plots on One Image</td></tr></table></div></body></html>