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.29. Example - Horizontal Thin Bar Line Plot</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-horizstackedbar.html" title="5.28. Example - Horizontal Stacked Bar Chart" /><link rel="next" href="ex-ohlcbasic.html" title="5.30. Example - Basic OHLC (Open, High, Low, Close) Financial Plot" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">5.29. Example - Horizontal Thin Bar Line Plot</th></tr><tr><td width="20%" align="left"><a accesskey="p" hr
ef="ex-horizstackedbar.html">Prev</a> </td><th width="60%" align="center">Chapter 5. PHPlot Examples</th><td width="20%" align="right"> <a accesskey="n" href="ex-ohlcbasic.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-horizthinbarline"></a>5.29. Example - Horizontal Thin Bar Line Plot</h2></div></div></div><p>
This example shows a horizontal thin bar line (thinbarline) plot.
As always, the X axis is horizontal, and the Y axis is vertical.
The data type 'data-data-yx' indicates this is a
horizontal plot, with explicit independent (Y) variables. There is
one X for each Y. With this data type, the independent variable
values need not be in order or sequential in the data array.
</p><div class="example"><a id="example-horizthinbarline"></a><p class="title"><strong>Example 5.29. Horizontal Thin Bar Line Plot</strong></p><div class="example-contents"><div class="informalfigure"><div class="mediaobject"><img src="examples/horizthinbarline.png" alt="Horizontal Thin Bar Line Plot Example" /></div></div><pre class="programlisting"><?php
# PHPlot example - horizontal thinbarline plot (impulse plot)
require_once 'phplot.php';
$data = array(
array('', 79, 33.18), array('', 13, 22.62), array('', 71, 41.18),
array('', 8, 14.72), array('', 48, 49.92), array('', 46, 49.68),
array('', 90, 18.00), array('', 15, 25.50), array('', 73, 39.42),
array('', 30, 42.00), array('', 24, 36.48), array('', 85, 25.50),
array('', 14, 24.08), array('', 3, 5.82), array('', 98, 3.92),
array('', 39, 47.58), array('', 70, 42.00), array('', 16, 26.88),
array('', 81, 30.78), array('', 40, 48.00), array('', 44, 49.28),
);
$plot = new PHPlot(800, 400);
$plot->SetImageBorderType('plain'); // Improves presentation in the manual
$plot->SetUseTTF(True);
$plot->SetTitle('Experimental Results');
$plot->SetXTitle('Density (g/cm&#179;)'); // 179=superscript 3
$plot->SetYTitle('Temperature (&#176;C)'); // 176=degrees
$plot->SetPlotType('thinbarline');
$plot->SetDataType('data-data-yx');
$plot->SetDataValues($data);
$plot->SetPlotAreaWorld(0, 0, 50, 100);
$plot->SetLineWidths(4);
$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-horizstackedbar.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-ohlcbasic.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">5.28. Example - Horizontal Stacked Bar Chart </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> 5.30. Example - Basic OHLC (Open, High, Low, Close) Financial Plot</td></tr></table></div></body></html>