<?xml version="1.0" encoding="windows-1252"?>
<node id="495716" title="Re: GD Graph" created="2005-09-28 08:42:14" updated="2005-09-28 04:42:14">
<type id="11">
note</type>
<author id="59896">
tomhukins</author>
<data>
<field name="doctext">
&lt;p&gt;
You say that your script fails, but not how it fails.  Do you see error messages?  Does it not do what you want?  If so, what does it do and what do you want it to do?
&lt;/p&gt;

&lt;p&gt;
Essentially, you're tackling two problems:  pulling data from a database and building a chart.  Try isolating the code to perform each problem separately.
&lt;/p&gt;

&lt;p&gt;
Firstly, query the database and check you have the data structures you expect in &lt;code&gt;$projectname&lt;/code&gt;, &lt;code&gt;@dat&lt;/code&gt; and &lt;code&gt;$pno&lt;/code&gt; using [cpan://Data::Dumper] and &lt;code&gt;warn&lt;/code&gt; in your &lt;code&gt;foreach&lt;/code&gt; loop.
&lt;/p&gt;

&lt;p&gt;
Secondly pass data of the form you expect to retrieve from the database to &lt;code&gt;GD::Graph::bars&lt;/code&gt; and see what happens.
&lt;/p&gt;</field>
<field name="root_node">
495713</field>
<field name="parent_node">
495713</field>
</data>
</node>
