﻿<?xml version='1.0' encoding='UTF-8'?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>FusionCharts Forum / FusionCharts Free / FusionCharts Free and PHP   / where to give set element for color attribute of bar chart / Latest Posts</title><generator>InstantForum.NET v4.1.4</generator><description>FusionCharts Forum</description><link>http://www.fusioncharts.com/forum/</link><webMaster>support@fusioncharts.com</webMaster><lastBuildDate>Tue, 02 Dec 2008 06:16:02 GMT</lastBuildDate><ttl>20</ttl><item><title>RE: where to give set element for color attribute of bar chart</title><link>http://www.fusioncharts.com/forum/Topic5786-43-1.aspx</link><description>Thanks for reply. I made the changes you suggested. Now it works fine.</description><pubDate>Mon, 21 Apr 2008 02:32:30 GMT</pubDate><dc:creator>maheshshinde9</dc:creator></item><item><title>RE: where to give set element for color attribute of bar chart</title><link>http://www.fusioncharts.com/forum/Topic5786-43-1.aspx</link><description>Hi,&lt;/P&gt;&lt;P&gt;&lt;TABLE cellSpacing=0 cellPadding=0 width="100%"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD class=BigTxt vAlign=top&gt;&lt;SPAN id=_ctl1_ctlTopic_ctlPanelBar_ctlTopicsRepeater__ctl3_lblFullMessage&gt;Could you please use FC_Colors.php that we provide in the Includes folder inside folder : CODE &amp;gt;&amp;gt; PHP.&lt;P&gt;Using this you can use :&lt;BR&gt;&lt;BR&gt; getFCColor() function to sequentially generate colors from a list of 20 colors. Could you please see the Code samples using this function in folders  Code &amp;gt;&amp;gt; PHP &amp;gt;&amp;gt; Array Examples / DBExample etc.&lt;/SPAN&gt; &lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;</description><pubDate>Mon, 21 Apr 2008 02:19:24 GMT</pubDate><dc:creator>Sudipto Choudhury</dc:creator></item><item><title>RE: where to give set element for color attribute of bar chart</title><link>http://www.fusioncharts.com/forum/Topic5786-43-1.aspx</link><description>please tell me solution for the above query or question? or haven't you got my question?</description><pubDate>Mon, 21 Apr 2008 01:28:35 GMT</pubDate><dc:creator>maheshshinde9</dc:creator></item><item><title>RE: where to give set element for color attribute of bar chart</title><link>http://www.fusioncharts.com/forum/Topic5786-43-1.aspx</link><description>I am using set element in while loop that while loop execute twice.&lt;/P&gt;&lt;P&gt;I have given color attribute in set element as follows&lt;/P&gt;&lt;P&gt; $strDataXML .= "&amp;lt;set value='" . $ors['output'] . "'  color='ACD43F'/&amp;gt;";&lt;/P&gt;&lt;P&gt;but because of that while loop executed twice it shows the same color for both individual bars.&lt;/P&gt;&lt;P&gt;can you tell me solution?</description><pubDate>Mon, 21 Apr 2008 01:07:16 GMT</pubDate><dc:creator>maheshshinde9</dc:creator></item><item><title>RE: where to give set element for color attribute of bar chart</title><link>http://www.fusioncharts.com/forum/Topic5786-43-1.aspx</link><description>Hi,&lt;/P&gt;&lt;P&gt;Could you please try setting color  attribute to &amp;lt;dataset&amp;gt; element if you with to give each dataset a separate color?&lt;/P&gt;&lt;P&gt;You can also use color attribute in each &amp;lt;set&amp;gt; element which would set color for each dataplot of your chart.</description><pubDate>Mon, 21 Apr 2008 00:49:02 GMT</pubDate><dc:creator>Sudipto Choudhury</dc:creator></item><item><title>where to give set element for color attribute of bar chart</title><link>http://www.fusioncharts.com/forum/Topic5786-43-1.aspx</link><description>Following is the example of multiseries bar chart.That contains two series(two bars).&lt;/P&gt;&lt;P&gt;I want to give two different colors for that two bars.&lt;/P&gt;&lt;P&gt;&lt;TABLE cellSpacing=0 cellPadding=0 width="100%"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD class=smalltxt vAlign=top&gt;&lt;SPAN id=_ctl1_ctlTopic_ctlPanelBar_ctlTopicsRepeater__ctl1_lblFullMessage&gt;I am preparing bar chart in php with mysql as database. Following is the php code &lt;P&gt;tell me where to give colour attribute in following code OR tell me which file to include?&lt;/P&gt;&lt;P&gt;   $strXML = "&amp;lt;graph caption='Factory  Output ' subcaption='(In Units)' xAxisName='Date' formatNumberScale='0' decimalPrecision='0' &amp;gt;";&lt;/P&gt;&lt;P&gt;    // Connet to the DB&lt;BR&gt;    &lt;BR&gt; &lt;BR&gt;   //To store categories - also flag to check whether category is already generated&lt;BR&gt;   $catXMLDone = false;&lt;BR&gt; //Initialize XML elements&lt;BR&gt; $strCat = "&amp;lt;categories&amp;gt;";&lt;BR&gt; &lt;BR&gt; //First we need to get unique categories in the database&lt;BR&gt; $strSQL = "SELECT DISTINCT(p.product_type_id) as ids, Year(o.order_complete) as years FROM &lt;BR&gt;order_items as oi, orders as o,products as p WHERE p.product_type_id &amp;gt;2 AND p.product_id = oi.product_id AND Year(o.order_complete) ='2008'  AND o.order_id = oi.order_id GROUP BY oi.product_id";&lt;/P&gt;&lt;P&gt;&lt;BR&gt;    $result = mysql_query($strSQL) or die(mysql_error());&lt;BR&gt; &lt;BR&gt;  //To store datasets and sets&lt;BR&gt;    $strDataXML = "";&lt;BR&gt; &lt;BR&gt;   if ($result) &lt;BR&gt;   {&lt;BR&gt;        while($orsCat = mysql_fetch_array($result)) &lt;BR&gt;  {&lt;BR&gt;            //Add this category as dataset&lt;BR&gt;            $strDataXML .= "&amp;lt;dataset seriesName='".$orsCat['ids']."'&amp;gt;";&lt;/P&gt;&lt;P&gt;    //Now, we get the data for that factory&lt;BR&gt;      $strSQL = "SELECT SUM(Total) as output,months1, years FROM(SELECT COUNT(oi.product_id) as Total, Month(o.order_complete) as months1 ,Year(o.order_complete) as years FROM order_items as oi, orders as o,products as p WHERE p.product_type_id = '".$orsCat['ids']."' AND p.product_id = oi.product_id AND Year(o.order_complete)='".$orsCat['years']."' AND o.order_id = oi.order_id GROUP BY months1) as chart GROUP BY months1";&lt;BR&gt;     //Execute it&lt;BR&gt;            $result2 = mysql_query($strSQL) or die(mysql_error());&lt;BR&gt;            while($ors = mysql_fetch_array($result2))&lt;BR&gt;    {&lt;BR&gt;   //Append &amp;lt;category label=''&amp;gt; if not already done&lt;BR&gt;                if (!$catXMLDone) &lt;BR&gt;    {&lt;BR&gt;                   $strCat .= "&amp;lt;category name='" .$ors['months1']. "' /&amp;gt;";&lt;BR&gt;               }&lt;BR&gt;               //Append data&lt;BR&gt;                 $strDataXML .= "&amp;lt;set value='" . $ors['output'] . "' /&amp;gt;";&lt;BR&gt;   }&lt;BR&gt;            //Update flag that we've appended categories  &lt;BR&gt;            $catXMLDone = true;&lt;BR&gt;            //Clear up objects&lt;BR&gt;            mysql_free_result($result2);&lt;BR&gt;            //Close dataset element&lt;BR&gt;            $strDataXML .= "&amp;lt;/dataset&amp;gt;";&lt;BR&gt;        }&lt;BR&gt;    }&lt;BR&gt;   // mysql_close($link);&lt;/P&gt;&lt;P&gt;    //Close &amp;lt;/categories&amp;gt;&lt;BR&gt; $strCat .= "&amp;lt;/categories&amp;gt;";&lt;BR&gt; //Create full XML&lt;BR&gt; $strXML .= $strCat.$strDataXML;&lt;/P&gt;&lt;P&gt;    //Return&lt;BR&gt; //return $strXML;&lt;/P&gt;&lt;P&gt;    //Close &amp;lt;graph&amp;gt; element&lt;BR&gt;    $strXML .= "&amp;lt;/graph&amp;gt;";&lt;/SPAN&gt; &lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;</description><pubDate>Mon, 21 Apr 2008 00:32:22 GMT</pubDate><dc:creator>maheshshinde9</dc:creator></item></channel></rss>