Fusion Charts Java Charting Package
April 30th, 2009I'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 the appropriate FusionCharts xml string to use in your jsp page.
Instead of using FusionChartsRenderer.jsp I have created a custom chartBuilder.jsp that takes the graph object created and outputs the string for you.
I've also included 2 example jsps utilizing the charting package.
Feel free to edit the code and it would be great if you could share any additional improvements.
You can download the source code, javadoc, and examples below
Download the Fusion Chart Java user guide
Online Documentation on using the Java classes can be found in the next page of this post
Pages: 1 · 2
Fusion Charts DOM Fix
April 28th, 2009FusionCharts 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 <fusioncharts> ... </fusioncharts> tags in your HTML code. Configuration of the charts is as simple as providing attributes to this HTML element.
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 <fusioncharts> HTML tags within your documents. The included javascript does all the hard work of elegantly converting your <fusioncharts> HTML tags into impressive charts
Problem:
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.
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.
I have attached the correct code that you can find here.
For those who are interested in the fix details
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.
Starting at the Constructor, go to the method _FCD.parseDOM(). In the parseDOM() method, there's a for loop that processes through all the tags that contain charts. The "processTag(tagObj)" method is where the node properties are set and the problem occurs here.
In the processTag(tagObj) function, look for the part where the newAttributes.chartid is set. It calls a method called _FCDL.uniqueId() 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.
To fix this, I just added an optional index parameter to the "processTag" function
_FCD.processTag = function(tagObj, idx)
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.
if(!newAttributes.chartid)
{
if(_FCD.Settings.autochartid)
newAttributes.chartid = _FCDR.idPrefix + _FCDL.uniqueId() + ('_'+idx);
else // in case autochartid is off, throw an error
{
_FCD.notify(_FCDR.errorNoChartId);
throw _FCDR.errorNoChartId;
}
}
Fusion Charts for dashboarding
April 24th, 2009
I'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 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.
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'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.
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.
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.
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.
Please take a look at the following link for an example dashboard produced using FusionCharts.
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.
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.
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.