<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>David Lai&#039;s Business Intelligence Blog &#187; Fusion Charts</title>
	<atom:link href="http://davidlai101.com/blog/category/fusion-charts/feed/" rel="self" type="application/rss+xml" />
	<link>http://davidlai101.com/blog</link>
	<description>Just another WordPress weblog</description>
	<lastBuildDate>Fri, 23 Jul 2010 05:53:28 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Fusion Charts Wrapper Online Guide</title>
		<link>http://davidlai101.com/blog/2010/02/03/fusion-charts-wrapper-online-guide/</link>
		<comments>http://davidlai101.com/blog/2010/02/03/fusion-charts-wrapper-online-guide/#comments</comments>
		<pubDate>Wed, 03 Feb 2010 07:14:37 +0000</pubDate>
		<dc:creator>David Lai</dc:creator>
				<category><![CDATA[Fusion Charts]]></category>
		<category><![CDATA[Java Wrapper]]></category>
		<category><![CDATA[Online Guide]]></category>

		<guid isPermaLink="false">http://davidlai101.com/blog/?p=186</guid>
		<description><![CDATA[Here&#8217;s the online guide to the Fusion Charts Wrapper found at http://davidlai101.com/blog/2010/02/02/fusion-charts-java-wrapper-updated/
If you just need the JavaDocs, please go to http://davidlai101.com/fusioncharts-javadoc/
Steps to build a Fusion Chart in Java
Please ensure that you have example.jsp and example_alternative.jsp open in order to follow the steps below to build a fusion graph.
If you haven&#8217;t downloaded the full project file [...]]]></description>
			<content:encoded><![CDATA[<p>Here&#8217;s the online guide to the Fusion Charts Wrapper found at <a href="http://davidlai101.com/blog/2010/02/02/fusion-charts-java-wrapper-updated/">http://davidlai101.com/blog/2010/02/02/fusion-charts-java-wrapper-updated/</a></p>
<p>If you just need the <em>JavaDocs</em>, please go to <a href="http://davidlai101.com/fusioncharts-javadoc/">http://davidlai101.com/fusioncharts-javadoc/</a></p>
<h3><span style="color: #3366ff;"><strong>Steps to build a Fusion Chart in Java</strong></span></h3>
<p>Please ensure that you have example.jsp and example_alternative.jsp open in order to follow the steps below to build a fusion graph.</p>
<p>If you haven&#8217;t downloaded the full project file please download it <a href="http://www.davidlai101.com/blog/media/blogs/bobj/fusioncharts/1.0/fusioncharts-fullsource.zip">here</a></p>
<h3><span style="color: #3366ff;"><strong>Create FusionGraph</strong></span></h3>
<p>First you will want to create a FusionGraph object and set its properties<br />
To create a FusionGraph object you will need to define a Graph Id, Chart Type which is an enum from ChartType and the size of items in each of it’s series.  Let’s start with a simple pie graph example that has 5 slices.<br />
<span id="more-186"></span></p>
<blockquote><p>FusionGraph pieGraph = new FusionGraph(“pieGraph”,ChartType.PIE3D,5,request);</p></blockquote>
<p>Note that the request parameter is required so that we can send the FusionGraph object within jsps.<br />
Next you may want to set the properties of the graph by giving it a customized look.  Please refer to the Chart XML API found in <a href="http://www.fusioncharts.com/docs" target="_blank">http://www.fusioncharts.com/docs</a> for the properties you can customize.</p>
<p>For example if I wanted to set the background of the graph to a gradient of white and yellow I would do this:</p>
<blockquote><p>graph.setChartProperties(“bgColor”,”FFFFFF,CCCC33”);</p></blockquote>
<p>You will also want to set the width and height of the graph by using the <em>setWidth(int)</em> and <em>setHeight(int)</em> methods, or just go with the default which is width=600, height=300.<br />
<img class="alignleft size-full wp-image-190" title="guide1" src="http://davidlai101.com/blog/wp-content/uploads/2010/02/guide1.jpg" alt="" width="618" height="506" /><br />
Now to create a series inside the graph:</p>
<blockquote><p>Series series = graph.createSeries(“pieSeries”);</p></blockquote>
<p><img class="alignleft size-full wp-image-192" title="guide2" src="http://davidlai101.com/blog/wp-content/uploads/2010/02/guide2.jpg" alt="" width="738" height="97" /></p>
<h3><span style="color: #3366ff;"><strong>Series</strong></span></h3>
<p>You will have one or more series containing data.</p>
<p>The series object has a set of member properties that you can set.  Please refer to the API for more information.</p>
<p>For the pie graph you will probably want to set the values, and the colors for each pie.<br />
To do this you can use the <span style="color: red;">setColor(int index, String color)</span> and <span style="color: red;">setValue(int index, double value)</span> methods.<br />
<img class="alignleft size-full wp-image-193" title="guide3" src="http://davidlai101.com/blog/wp-content/uploads/2010/02/guide3.jpg" alt="" width="835" height="147" /></p>
<h3><span style="color: #3366ff;"><strong>ChartFactory</strong></span></h3>
<p>When you are finished creating the graph, you will want to put the graph in a ChartFactory so that the Chart Factory can build the desired xml string for the data.  To generate the data for the pie graph, code the following:</p>
<blockquote><p>ChartFactory chartFactory = new ChartFactory();<br />
chartFactory.insertGraph(pieGraph);<br />
chartFactory.buildFusionChart(“pieGraph”); //or use pieGraph.getGraphId() for the String parameter</p></blockquote>
<p>A new method called “buildDOMFusionChart(String graphName) was created so that we could utilize the FusionChartsDOM_commented.js which allows us to use an html tag to display the fusion chart.</p>
<p>All you need to do is add the following line instead of “chartFactory.buildFusionChart(“pieGraph”)</p>
<p>You would use on the jsp</p>
<blockquote><p>chartFactory.buildDOMFusionChart(“pieGraph”);</p></blockquote>
<p><img class="alignleft size-full wp-image-195" title="guide4" src="http://davidlai101.com/blog/wp-content/uploads/2010/02/guide4.jpg" alt="" width="819" height="383" /></p>
<p>You will need to include in your body tag</p>
<blockquote><p><span style="color: #ff0000;">&lt;body onload=&#8221;setTimeout(&#8216;FusionChartsDOM.RenderAllCharts(true)&#8217;,1000)&#8221;&gt;</span></p></blockquote>
<p>In addition make sure you have the scripts loaded into your jsp if you are using jsp</p>
<blockquote><p>&lt;SCRIPT LANGUAGE=&#8221;Javascript&#8221; SRC=&#8221;/FusionCharts/FusionCharts.js&#8221;&gt;&lt;/SCRIPT&gt;</p>
<p>&lt;script type=&#8221;text/javascript&#8221; src=&#8221;/FusionCharts/FusionChartsDOM_commented.js&#8221;&gt;&lt;/script&gt;</p></blockquote>
<p><img class="alignleft size-full wp-image-196" title="guide5" src="http://davidlai101.com/blog/wp-content/uploads/2010/02/guide5.jpg" alt="" width="799" height="196" /></p>
<h3><span style="color: #3366ff;"><strong>Using the helper chartBuilder.jsp</strong></span></h3>
<p>The chartBuilder.jsp has built in Javascript that works with FusionCharts.js and renders the chart for you provided that you provide the correct graph parameter.  You can either use this method or the buildDOMFusionChart method which is newer.</p>
<p>All you need to do is provide the graphId of the graph you want to display</p>
<p>For example if I wanted to display the pie graph from the earlier examples, I would do this</p>
<blockquote><p>&lt;jsp:include page=”/tools/chartBuilder.jsp” flush=”true”&gt;</p>
<p>&lt;jsp:param name=”graphId” value=”pieGraph”/&gt;</p>
<p>//or use &lt;%=pieGraph.getGraphId() %&gt; instead of the string</p>
<p>&lt;/jsp:include&gt;</p></blockquote>
<p><span style="color: #ff0000;"><em><strong>Note: You must use example_alternative.jsp to see this</strong></em></span><br />
<img class="alignleft size-full wp-image-197" title="guide6" src="http://davidlai101.com/blog/wp-content/uploads/2010/02/guide6.jpg" alt="" width="705" height="408" /></p>
<h3><strong>Example.jsp and example_alternative.jsp</strong></h3>
<p>Please take a look at the example.jsp attached that will help you build a pie graph using the DOM method.  Example_alternative.jsp provides an example of building a chart using the chartBuilder.jsp method.  The drawback of using the chartBuilder.jsp method is that you make another server call when calling that jsp.  So with pages that have many charts, it will be better using the DOM method.</p>
]]></content:encoded>
			<wfw:commentRss>http://davidlai101.com/blog/2010/02/03/fusion-charts-wrapper-online-guide/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Fusion Charts Java Wrapper Updated</title>
		<link>http://davidlai101.com/blog/2010/02/02/fusion-charts-java-wrapper-updated/</link>
		<comments>http://davidlai101.com/blog/2010/02/02/fusion-charts-java-wrapper-updated/#comments</comments>
		<pubDate>Tue, 02 Feb 2010 07:02:10 +0000</pubDate>
		<dc:creator>David Lai</dc:creator>
				<category><![CDATA[Fusion Charts]]></category>
		<category><![CDATA[Fusion Charts Documentation]]></category>
		<category><![CDATA[Installation]]></category>
		<category><![CDATA[Java Wrapper]]></category>

		<guid isPermaLink="false">http://davidlai101.com/blog/?p=157</guid>
		<description><![CDATA[Fusion Charts Java Wrapper v1.0 released
I&#8217;ve updated the fusion charts java wrapper that I released in a previous post, however many people were having problems getting to work, so I&#8217;ve changed some stuff around and updated the wrapper with clear instructions on getting it to work for everyone.
The FusionCharts wrapper requires Java 1.5+ in order [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Fusion Charts Java Wrapper v1.0 released</strong></p>
<p>I&#8217;ve updated the fusion charts java wrapper that I released in a previous post, however many people were having problems getting to work, so I&#8217;ve changed some stuff around and updated the wrapper with clear instructions on getting it to work for everyone.</p>
<p>The FusionCharts wrapper requires Java 1.5+ in order to run so make sure you have this set in the compile settings.<br />
The package was tested on Eclipse JEE Galileo where you can download at the Eclipse website <a href="http://www.eclipse.org/downloads/download.php?file=/technology/epp/downloads/release/galileo/SR1/eclipse-jee-galileo-SR1-win32.zip" target="_blank">here</a><br />
With the Web Tools Platform 3.1.1 addon <a href="http://download.eclipse.org/webtools/downloads/" target="_blank">here</a><br />
In addition please install Tomcat which can be found <a href="http://tomcat.apache.org/download-60.cgi" target="_blank">here</a></p>
<p>I&#8217;ve released 4 versions that you can download ranging from the full source to just a war file.<br />
Please click on the links to download your desired version<br />
<a href="http://www.davidlai101.com/blog/media/blogs/bobj/fusioncharts/1.0/fusioncharts-fullsource.war">FusionCharts War File (web project)</a><br />
<a href="http://www.davidlai101.com/blog/media/blogs/bobj/fusioncharts/1.0/fusioncharts-fullsource.zip">FusionCharts Full Source (web project)</a><br />
<a href="http://www.davidlai101.com/blog/media/blogs/bobj/fusioncharts/1.0/fusioncharts.jar">FusionCharts Jar File</a><br />
<a href="http://www.davidlai101.com/blog/media/blogs/bobj/fusioncharts/1.0/fusioncharts-fullsource-code.zip">FusionCharts Full Source</a><br />
<a href="http://davidlai101.com/fusioncharts-javadoc/">Java Docs</a></p>
<p><strong>Part 1: Installation</strong><br />
<span id="more-157"></span><br />
I&#8217;ll explain how to install each version now.<br />
<strong>1.  Make sure your compiler is set to Java 1.5 or higher</strong><br />
<img class="alignleft size-full wp-image-159" title="java-compiler" src="http://davidlai101.com/blog/wp-content/uploads/2010/02/java-compiler.jpg" alt="" width="530" height="569" /></p>
<p><strong>2.  Make sure your buildpath is using a Java runtime of 5.0 or higher</strong><br />
<img class="alignleft size-full wp-image-161" title="java-build-path" src="http://davidlai101.com/blog/wp-content/uploads/2010/02/java-build-path.jpg" alt="" width="828" height="646" /></p>
<p><strong>3.  If you are using the WAR or the fullsource web project file (make sure you have unzipped it to your workspace), right click on the project explorer and select import either WAR or existing projects into workspace.<br />
</strong><br />
<img class="alignleft size-full wp-image-163" title="java-importwar" src="http://davidlai101.com/blog/wp-content/uploads/2010/02/java-importwar.jpg" alt="" width="655" height="581" /><br />
If you are using the JAR file, make sure you also import the jar into your WEB-INF lib folder<br />
<img class="size-full wp-image-164  alignnone" style="margin-left: 150px; margin-right: 150px;" title="webinf" src="http://davidlai101.com/blog/wp-content/uploads/2010/02/webinf.jpg" alt="" width="263" height="254" /></p>
<p><strong>4. GREAT! now if you want you can try running the examples</strong><br />
Start your tomcat server by right clicking on your project -&gt; run as -&gt; run on server.  Then select Tomcat and the location where you installed tomcat.<br />
<img class="alignleft size-full wp-image-169" title="java-runserver" src="http://davidlai101.com/blog/wp-content/uploads/2010/02/java-runserver.jpg" alt="" width="725" height="667" /></p>
<p>Finally go to your browser of choice and test out the example_alternative.jsp<br />
<img class="alignleft size-full wp-image-170" title="fusionfullsourcefinal" src="http://davidlai101.com/blog/wp-content/uploads/2010/02/fusionfullsourcefinal.jpg" alt="" width="738" height="310" /></p>
<p>For instructions on using the wrapper please click on my next post <a href="http://davidlai101.com/blog/2010/02/03/fusion-charts-wrapper-online-guide/">here</a><br />
or you can download the user guide <a href="http://www.davidlai101.com/blog/media/blogs/bobj/fusioncharts/1.0/FusionCharts_Userguide1.3.doc">here</a></p>
<p>In addition click <a href="http://davidlai101.com/fusioncharts-javadoc/">here</a> to access the Java Docs</p>
]]></content:encoded>
			<wfw:commentRss>http://davidlai101.com/blog/2010/02/02/fusion-charts-java-wrapper-updated/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Fusion Charts Java Charting Package</title>
		<link>http://davidlai101.com/blog/2009/04/30/fusionchartsjava/</link>
		<comments>http://davidlai101.com/blog/2009/04/30/fusionchartsjava/#comments</comments>
		<pubDate>Fri, 01 May 2009 03:05:12 +0000</pubDate>
		<dc:creator>David Lai</dc:creator>
				<category><![CDATA[Fusion Charts]]></category>
		<category><![CDATA[charting package]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[wrapper]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[NOTE: Please note that the wrapper has been updated and you can get the latest code at
http://davidlai101.com/blog/2010/02/02/fusion-charts-java-wrapper-updated/
I&#8217;ve created a Fusion Charts package that acts as a wrapper for the Java developers out there.
The charting package will help you attach data to your series and construct your graph.
In addition, there is a ChartFactory class which builds [...]]]></description>
			<content:encoded><![CDATA[<p><strong>NOTE: Please note that the wrapper has been updated and you can get the latest code at</strong><br />
<a href="http://davidlai101.com/blog/2010/02/02/fusion-charts-java-wrapper-updated/">http://davidlai101.com/blog/2010/02/02/fusion-charts-java-wrapper-updated/</a></p>
<p>I&#8217;ve created a Fusion Charts package that acts as a wrapper for the Java developers out there.</p>
<p>The charting package will help you attach data to your series and construct your graph.<br />
In addition, there is a ChartFactory class which builds the appropriate FusionCharts xml string to use in your jsp page.</p>
<p>Instead of using FusionChartsRenderer.jsp I have created a custom chartBuilder.jsp that takes the graph object created and outputs the string for you.</p>
<p>I&#8217;ve also included 2 example jsps utilizing the charting package.</p>
<p>Feel free to edit the code and it would be great if you could share any additional improvements.</p>
<p>You can download the source code, javadoc, and examples below</p>
<p><a href="http://davidlai101.com/blog/2010/02/02/fusion-charts-java-wrapper-updated/">Source Code and Examples</a></p>
<p>Download the Fusion Chart Java user guide </p>
<p><a href="http://www.davidlai101.com/blog/media/blogs/bobj/fusioncharts/1.0/FusionCharts_Userguide1.3.doc">User Guide</a></p>
<p>Online Documentation on using the Java classes can be found in the next page of this post<br />
<span id="more-22"></span></p>
<p><b>Fusion Charts and Java</b></p>
<p><b>Location of Required Fusion Chart files</b><br />
There is a mix of Java classes, jsps, javascripts, and chart swf files in order to work with Fusion Charts.</p>
<p>List of Java classes you will need to build Fusion Charts</p>
<p><i>Package FusionCharts</i></p>
<p>ChartFactory.java – builds the data string xml and the embeddable DOM tag<br />
ChartType.java – enum that holds values for the type of charts available<br />
Graph.java – Generic Graph class that provides generic members and methods<br />
FusionGraph.java – Extends the Graph class and provides FusionChart specific members and methods<br />
Series.java – Series class that holds each series and all their values</p>
<p><i>Resources</i><br />
	XMLWriter.jar – helper xml api that helps ChartFactory build the data xml string.</p>
<p><i>List of jsps needed to build Fusion Charts</i><br />
chartBuilder.jsp – A helper jsp that I created so that users do not have to put in the redundant code needed by FusionChartsRenderer.jsp and FusionChartsHTMLRenderer.jsp</p>
<p><i>List of Javascripts needed to build Fusion Charts</i><br />
FusionCharts.js – required Fusion Charts javascript file that displays your chart<br />
FusionChartsDOM_commented.js – required javascript to use DOM tags<br />
Flash files needed to build Fusion Charts</p>
<p><b>Steps to build a Fusion Chart in Java</b><br />
<b>Create FusionGraph</b><br />
First you will want to create a FusionGraph object and set its properties<br />
To create a FusionGraph object you will need to define a Graph Id, Chart Type which is an enum from ChartType and the size of items in each of it’s series.  Let’s start with a simple pie graph example that has 5 slices.</p>
<blockquote><p>FusionGraph pieGraph = new FusionGraph(“pieGraph”,ChartType.PIE3D,5,request);</p></blockquote>
<p>Note that the request parameter is required so that we can send the FusionGraph object within jsps.<br />
Now to create a series inside the graph:</p>
<blockquote><p>Series series = graph.createSeries(“pieSeries”);</p></blockquote>
<p>Next you may want to set the properties of the graph by giving it a customized look.  Please refer to the Chart XML API found in <a href="http://www.fusioncharts.com/docs" target="_blank">http://www.fusioncharts.com/docs</a> for the properties you can customize.<br />
For example if I wanted to set the background of the graph to a gradient of white and yellow I would do this:</p>
<blockquote><p>graph.setChartProperties(“bgColor”,”FFFFFF,CCCC33”);</p></blockquote>
<p>You will also want to set the width and height of the graph by using the setWidth(int) and setHeight(int) methods, or just go with the default which is width=600, height=300.</p>
<p><b>Series</b><br />
You will have one or more series containing data.<br />
The series object has a set of member properties that you can set.  Please refer to the API for more information.<br />
For the pie graph you will probably want to set the values, and the colors for each pie.<br />
To do this you can use the setColor(int index, String color) and setValue(int index, double value) methods.</p>
<p><b>ChartFactory</b><br />
When you are finished creating the graph, you will want to put the graph in a ChartFactory so that the Chart Factory can build the desired xml string for the data.  To generate the data for the pie graph, code the following:</p>
<blockquote><p>ChartFactory chartFactory = new ChartFactory();<br />
chartFactory.insertGraph(pieGraph);<br />
chartFactory.buildFusionChart(“pieGraph”); //or use pieGraph.getGraphId() for the String parameter</p></blockquote>
<p>New: A new method called “buildDOMFusionChart(String graphName) was created so that we could utilize the FusionChartsDOM_commented.js which allows us to use an html tag to display the fusion chart.<br />
All you need to do is add the following line instead of “chartFactory.buildFusionChart(“pieGraph”)<br />
You would use on the jsp</p>
<blockquote><p>chartFactory.buildDOMFusionChart(“pieGraph”);</p></blockquote>
<p>You will need to include in your body tag</p>
<blockquote><p>&lt;body onload=&#8221;setTimeout(&#8216;FusionChartsDOM.RenderAllCharts(true)&#8217;,1000)&#8221;&gt;</p></blockquote>
<p>In addition make sure you have the scripts loaded into your jsp if you are using jsp</p>
<blockquote><p>&lt;SCRIPT LANGUAGE=&#8221;Javascript&#8221; SRC=&#8221;/FusionCharts/FusionCharts.js&#8221;&gt;&lt;/SCRIPT&gt;<br />
&lt;script type=&#8221;text/javascript&#8221; src=&#8221;/FusionCharts/FusionChartsDOM_commented.js&#8221;&gt;&lt;/script&gt;</p></blockquote>
<p><b>Using the helper chartBuilder.jsp</b><br />
The chartBuilder.jsp has built in Javascript that works with FusionCharts.js and renders the chart for you provided that you provide the correct graph parameter.  You can either use this method or the buildDOMFusionChart method which is newer.<br />
All you need to do is provide the graphId of the graph you want to display<br />
For example if I wanted to display the pie graph from the earlier examples, I would do this</p>
<blockquote><p>&lt;jsp:include page=”/tools/chartBuilder.jsp” flush=”true”&gt;<br />
	&lt;jsp:param name=”graphId” value=”pieGraph”/&gt;<br />
//or use &lt;%=pieGraph.getGraphId() %&gt; instead of the string<br />
&lt;/jsp:include&gt;</p></blockquote>
<p><b>Example.jsp and example_alternative.jsp</b><br />
Please take a look at the example.jsp attached that will help you build a pie graph using the DOM method.  Example_alternative.jsp provides an example of building a chart using the chartBuilder.jsp method.  The drawback of using the chartBuilder.jsp method is that you make another server call when calling that jsp.  So with pages that have many charts, it will be better using the DOM method.</p>
]]></content:encoded>
			<wfw:commentRss>http://davidlai101.com/blog/2009/04/30/fusionchartsjava/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Fusion Charts DOM Fix</title>
		<link>http://davidlai101.com/blog/2009/04/28/fusion-charts-dom-fix/</link>
		<comments>http://davidlai101.com/blog/2009/04/28/fusion-charts-dom-fix/#comments</comments>
		<pubDate>Wed, 29 Apr 2009 03:06:04 +0000</pubDate>
		<dc:creator>David Lai</dc:creator>
				<category><![CDATA[Fusion Charts]]></category>
		<category><![CDATA[dom]]></category>
		<category><![CDATA[fix]]></category>
		<category><![CDATA[javascript]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[FusionCharts DOM is a JavaScript framework that helps you include FusionCharts in your web applications in a very elegant and easy way. Instead of writing standard Javascript codes or OBJECT/EMBED tags to embed charts, you can use FusionCharts DOM to create a chart by just including &#60;fusioncharts&#62; &#8230; &#60;/fusioncharts&#62; tags in your HTML code. Configuration [...]]]></description>
			<content:encoded><![CDATA[<p>FusionCharts DOM is a JavaScript framework that helps you include FusionCharts in your web applications in a very elegant and easy way. Instead of writing standard Javascript codes or OBJECT/EMBED tags to embed charts, you can use FusionCharts DOM to create a chart by just including &#60;fusioncharts&#62; &#8230; &#60;/fusioncharts&#62; tags in your HTML code. Configuration of the charts is as simple as providing attributes to this HTML element.</p>
<p>Essentially, FusionCharts DOM is a JavaScript file that you include in your HTML page. Once that is done, the rest is as simple as writing &#60;fusioncharts&#62; HTML tags within your documents. The included javascript does all the hard work of elegantly converting your &#60;fusioncharts&#62; HTML tags into impressive charts<br />
<span id="more-21"></span><br />
<b>Problem:</b></p>
<p>The FusionCharts DOM worked great and made it much more user friendly to include charts to a webpage, however when putting multiple charts on a page, only some charts would load.</p>
<p>In a nutshell, the cause of the problem was multiple charts having the same id.  This would cause the 2nd chart to overlap the first chart since the 2nd chart has the same id as the 1st chart.  So what I did was to ensure that every chart would have a unique id.</p>
<p>I have attached the correct code that you can find here.</p>
<p><a href="http://www.davidlai101.com/blog/media/blogs/bobj/fusioncharts/FusionChartsDOM.js">FusionChartsDOM.js</a></p>
<p><b>For those who are interested in the fix details</b></p>
<p>So after doing some debugging with the FusionChartsDOM.js I discovered that each chart on the page is a node object, part of an array.</p>
<p>Starting at the Constructor, go to the method _FCD.parseDOM().  In the parseDOM() method, there&#8217;s a for loop that processes through all the tags that contain charts.  The &#8220;processTag(tagObj)&#8221; method <b> is where the node properties are set and the problem occurs here</b>.</p>
<p>In the processTag(tagObj) function, look for the part where the newAttributes.chartid is set.  It calls a method called <b>_FCDL.uniqueId()</b> and in the uniqueId() method it takes the dateTime as a unique identifier.  However, the for loop that processes the tags sometimes goes too fast and because of this we will get the same time value for some node ids.</p>
<p>To fix this, I just added an optional index parameter to the &#8220;processTag&#8221; function </p>
<blockquote><p>_FCD.processTag = function(tagObj, <b>idx</b>)</p></blockquote>
<p>In the section where it declares a new chartid, I just attached the index at the back coming from the parseDOM() forloop to ensure uniqueness.</p>
<blockquote><p>if(!newAttributes.chartid)<br />
{<br />
	if(_FCD.Settings.autochartid)<br />
		<font color = "red">newAttributes.chartid = _FCDR.idPrefix + _FCDL.uniqueId() + (&#8216;_&#8217;+idx);</font><br />
	else // in case autochartid is off, throw an error<br />
	{<br />
		_FCD.notify(_FCDR.errorNoChartId);<br />
		throw _FCDR.errorNoChartId;<br />
	}<br />
}</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://davidlai101.com/blog/2009/04/28/fusion-charts-dom-fix/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Fusion Charts for dashboarding</title>
		<link>http://davidlai101.com/blog/2009/04/24/fusion-charts-for-dashboarding/</link>
		<comments>http://davidlai101.com/blog/2009/04/24/fusion-charts-for-dashboarding/#comments</comments>
		<pubDate>Sat, 25 Apr 2009 03:06:42 +0000</pubDate>
		<dc:creator>David Lai</dc:creator>
				<category><![CDATA[Fusion Charts]]></category>
		<category><![CDATA[charting]]></category>
		<category><![CDATA[dashboard]]></category>
		<category><![CDATA[flash charts]]></category>
		<category><![CDATA[free]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[
I&#8217;ve been working alot with Fusion Charts lately and found that Fusion Charts is able to produce the Wow factor that most of the other big name dashboarding tools produce.  
FusionCharts comes in a free version and a professional version.  The free version comes with 18 charts however these charts are quite bland [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://www.davidlai101.com/blog/media/blogs/bobj/fusioncharts/logo.png" alt="fusion charts logo" title="" /></p>
<p>I&#8217;ve been working alot with Fusion Charts lately and found that Fusion Charts is able to produce the Wow factor that most of the other big name dashboarding tools produce.  </p>
<p>FusionCharts comes in a free version and a professional version.  The free version comes with 18 charts however these charts are quite bland and I would recommend buying a license for the professional version since you are able to control many more aspects in the charts such as gradients, shadows, drilldowns, etc.  In addition, the professional package comes with 45 charts.</p>
<p>To get started, you only need to know a simple amount of HTML and how to configure the FusionChart tags on your page. It doesn&#8217;t have the drag and drop GUI other tools such as Xcelsius have but for developers that have some programming background, this should be simple.</p>
<p><span id="more-20"></span><br />
What I really like about FusionCharts is the amount of flexibility it provides for your application.  FusionCharts just provides you with the chart component, so everything else on your application is totally customizable.  Unlike other tools that produce a whole dashboard that you embed onto your page, you only need to generate the chart swfs wherever you want it on your application.</p>
<p>When using Xcelsius for example, it is very easy to produce a great looking dashboard quickly.  However, embedding it to your existing application and connecting it to data produces problems.  If you have an existing j2ee or .net web application, you can just add the code that constructs the data string that a Fusion Chart requires and then place the chart anywhere on the screen.</p>
<p>As of now FusionCharts has plugins for Visual Basic and Dreamweaver if you are interested in dragging and dropping Fusion Charts into your webpage or application.</p>
<p>Please take a look at the following link for an example dashboard produced using FusionCharts.</p>
<p><a href="http://www.fusioncharts.com/Demos/Blueprint/" target="_BLANK">FusionCharts Demo</a></p>
<p>Basically for anything not related to charts, you can use whatever you want so this gives developers endless possiblities for choosing the type of dropdown menus, reports, widgets, etc on their application.</p>
<p>Finally, the pricing for Fusion Charts is very attractive.  If you just want the charting package, it is only a one time licensing fee of $199 -> $1999 depending on what you intend to use Fusion charts for vs other dashboarding tools which go for $20k+ if you are an independant software vendor.</p>
<p>In conclusion, FusionCharts offers great flexibility and customization on your application, easy to connect data, and the ability to seamlessly embed charts into your application.  The only drawback is that FusionCharts is geared towards technical users, but hey you have to be somewhat technical to proficiently use other dashboarding tools as well.</p>
]]></content:encoded>
			<wfw:commentRss>http://davidlai101.com/blog/2009/04/24/fusion-charts-for-dashboarding/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
