|
|
|
Forum Member
      
Group: Forum Members
Last Login: 4/29/2008 4:06:17 AM
Posts: 44,
Visits: 93
|
|
| this is php code i am using. This example works with pie chart but not with bar chart. I tried to use different chart in renderchart sentense .but it did not work .I used order by clause in sql sentense then also it didnot work. give me solution. <?php $link = connectToDB(); $strXML = "<chart palette='2' caption='Factory Output ' subcaption='(In Units)' xAxisName='Date' showValues='1' labelStep='2' >"; $strQuery = "SELECT count(o.product_id) as Total, p.product_short_desc, p.product_desc, o.product_id FROM products as p, order_items as o WHERE p.product_type_id='3' AND p.product_id=o.product_id GROUP BY p.product_short_desc"; $result = mysql_query($strQuery) or die(mysql_error()); if ($result) { while($ors = mysql_fetch_array($result)) { $strXML .= "<set label='" . $ors['product_short_desc'] . "' value='" . $ors['Total'] . "' />"; } } mysql_close($link); //Finally, close <graph> element $strXML .= "</chart>"; //Create the chart with data from $strXML echo renderChart("FusionCharts/FCF_Bar2D.swf", "", $strXML, "FactoryDetailed", 600, 300, false, false); ?>
|
|
|
|
|
Supreme Being
      
Group: Moderators
Last Login: Yesterday @ 2:58:00 AM
Posts: 811,
Visits: 1,289
|
|
| Hi, Since you are using FREE version of chart (FCF_Bar2D.swf), could you please try changing <chart> to <graph> , 'label' to 'name' and </chart> to </graph>; since these are the valid XML elements and attributes for vFREE charts. On the contrary could you please use Bar2D.swf (v3 chart)?
Regards,
Sudipto Choudhury FusionCharts Team
|
|
|
|