PDA

View Full Version : Beautiful Flash Charts: Part II



ngoodman
06-14-2008, 02:31 AM
So, it appears as if there was some pent up demand for great looking flash charts. The brief couple of days that my initial post on my rough integration work with Open Flash Charts I’ve had:
- 2 Pentaho Partners ask for the solution so they can start using it
- 3 Community members ask about it (including one who started but never finished a similar task)
- An existing customer decide to implement it
Cool! As an open source guy, I believe in early and often, so I’m posting my .xactions for this stuff here.
Installation Steps

Have a working Sample BI Server
Drop open-flash-chart-.swf (http://www.nicholasgoodman.com/entry_images/open-flash-chart.swf) into pentaho-demo/jboss/server/default/deploy/pentaho-style.war
Drop flash_chart_example_bar.xaction (http://www.nicholasgoodman.com/entry_images/flash_chart_example_bar.xaction) and flash_chart_example.xaction (http://www.nicholasgoodman.com/entry_images/flash_chart_example.xaction)into pentaho-solutions/samples/chartsThat should you get two the sample bar chart and the sample pie chart working.
These action sequences are kind of fancy. They do a fair bit of string replacements, result set walking, etc. So, they aren’t for the casual user but if you’ve done some Pentaho stuff before you’ll be able to work your way through it.
The interesting part is really the “datacall=true” branch. The first time the action sequence is called it returns a fragment of code that contains the flash object.
In this fragment, the flash object is given a “datafile” location which is the same action sequence but with a datacall=true.
The datacall=”true” basically returns a text file that looks like this:

&y_min=0& &y_max=40000000& &y_steps=4& &title=Actual vs Budget by Region,{font-size:20px; color: #bcd6ff; margin:10px; background-color: #5E83BF; padding: 5px 15px 5px 15px;}& &y_legend=USD,12,#736AFF& &x_labels=Central,Eastern,Southern,Western& &x_axis_colour=#909090& &x_grid_colour=#D2D2FB& &y_axis_colour=#909090& &y_grid_colour=#D2D2FB& &bar_glass=55,#D54C78,#C31812,Actuals,12& &values=37893162,35248940,35248940,35248940& &bar_glass_2=55,#5E83BF,#424581,Budget,12& &values_2=38397600,35487861,34803861,34510067&
This text file is really what gives the flash chart it’s form, labels, and data.
Again, this is quick and dirty implementation but it’s a life saver if you need something more than the charting in the platform.


More... (http://www.nicholasgoodman.com/bt/blog/2008/06/13/beautiful-flash-charts-part-ii/)