{"id":261,"date":"2008-06-13T18:35:21","date_gmt":"2008-06-14T01:35:21","guid":{"rendered":"http:\/\/www.nicholasgoodman.com\/bt\/blog\/2008\/06\/13\/beautiful-flash-charts-part-ii\/"},"modified":"2008-06-13T18:35:21","modified_gmt":"2008-06-14T01:35:21","slug":"beautiful-flash-charts-part-ii","status":"publish","type":"post","link":"http:\/\/www.nicholasgoodman.com\/bt\/blog\/2008\/06\/13\/beautiful-flash-charts-part-ii\/","title":{"rendered":"Beautiful Flash Charts: Part II"},"content":{"rendered":"<p>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&#8217;ve had:<br \/>\n&#8211; 2 Pentaho Partners ask for the solution so they can start using it<br \/>\n&#8211; 3 Community members ask about it (including one who started but never finished a similar task)<br \/>\n&#8211; An existing customer decide to implement it<\/p>\n<p>Cool!  As an open source guy, I believe in early and often, so I&#8217;m posting my .xactions for this stuff here.<\/p>\n<p>Installation Steps<\/p>\n<ol>\n<li>Have a working Sample BI Server<\/li>\n<li>Drop <a href=\"http:\/\/www.nicholasgoodman.com\/entry_images\/open-flash-chart.swf\">open-flash-chart-.swf<\/a> into <span style=\"text-decoration:line-through;\">pentaho-demo\/jboss\/server\/default\/deploy\/pentaho-style.war<\/span> pentaho-demo\/jboss\/server\/default\/deploy\/pentaho-style.war\/images (nice catch in comments below)<\/li>\n<li>Drop <a href=\"http:\/\/www.nicholasgoodman.com\/entry_images\/flash_chart_example_bar.xaction\">flash_chart_example_bar.xaction<\/a> and <a href=\"http:\/\/www.nicholasgoodman.com\/entry_images\/flash_chart_example.xaction\">flash_chart_example.xaction <\/a>into pentaho-solutions\/samples\/charts<\/li>\n<\/ol>\n<p>That should you get two the sample bar chart and the sample pie chart working.<\/p>\n<p>These action sequences are kind of fancy.  They do a fair bit of string replacements, result set walking, etc.  So, they aren&#8217;t for the casual user but if you&#8217;ve done some Pentaho stuff before you&#8217;ll be able to work your way through it.<\/p>\n<p>The interesting part is really the &#8220;datacall=true&#8221; branch.  The first time the action sequence is called it returns a fragment of code that contains the flash object.<\/p>\n<blockquote><p>&lt;object classid=&#8221;clsid:d27cdb6e-ae6d-11cf-96b8-444553540000&#8243; codebase=&#8221;http:\/\/fpdownload.macromedia.com\/pub\/shockwave\/cabs\/flash\/swflash.cab#version=8,0,0,0&#8243; width=&#8221;600&#8243; height=&#8221;500&#8243; id=&#8221;graph-2&#8243; align=&#8221;middle&#8221;&gt;&lt;param name=&#8221;allowScriptAccess&#8221; value=&#8221;sameDomain&#8221; \/&gt; &lt;param name=&#8221;movie&#8221; value=&#8221;\/pentaho-style\/images\/open-flash-chart.swf?width=600&#38;height=500&#38;<strong>data=http%3A\/\/localhost%3A8080\/pentaho\/ViewAction%3Fsolution%3Dsamples%26path%3Dcharts%26action%3Dflash_chart_example_bar.xaction%26datacall%3Dtrue<\/strong>&#8221; \/&gt; &lt;param name=&#8221;quality&#8221; value=&#8221;high&#8221; \/&gt;&lt;param name=&#8221;bgcolor&#8221; value=&#8221;#FFFFFF&#8221; \/&gt; &lt;embed src=&#8221;\/pentaho-style\/images\/open-flash-chart.swf?width=600&#38;height=500&#38;<strong>data=http%3A\/\/localhost%3A8080\/pentaho\/ViewAction%3Fsolution%3Dsamples%26path%3Dcharts%26action%3Dflash_chart_example_bar.xaction%26datacall%3Dtrue<\/strong>&#8221; quality=&#8221;high&#8221; bgcolor=&#8221;#FFFFFF&#8221; width=&#8221;600&#8243; height=&#8221;500&#8243; name=&#8221;open-flash-chart&#8221; align=&#8221;middle&#8221; allowScriptAccess=&#8221;sameDomain&#8221; type=&#8221;application\/x-shockwave-flash&#8221; pluginspage=&#8221;http:\/\/www.macromedia.com\/go\/getflashplayer&#8221; \/&gt; &lt;\/object&gt;<\/p><\/blockquote>\n<p>In this fragment, the flash object is given a &#8220;datafile&#8221; location which is the same action sequence but with a datacall=true.<\/p>\n<p>The datacall=&#8221;true&#8221; basically returns a text file that looks like this:<\/p>\n<blockquote><p>&#38;y_min=0&#38; &#38;y_max=40000000&#38; &#38;y_steps=4&#38; &#38;title=Actual vs Budget by Region,{font-size:20px; color: #bcd6ff; margin:10px; background-color: #5E83BF; padding: 5px 15px 5px 15px;}&#38; &#38;y_legend=USD,12,#736AFF&#38; &#38;x_labels=Central,Eastern,Southern,Western&#38; &#38;x_axis_colour=#909090&#38; &#38;x_grid_colour=#D2D2FB&#38; &#38;y_axis_colour=#909090&#38; &#38;y_grid_colour=#D2D2FB&#38; &#38;bar_glass=55,#D54C78,#C31812,Actuals,12&#38; &#38;values=37893162,35248940,35248940,35248940&#38; &#38;bar_glass_2=55,#5E83BF,#424581,Budget,12&#38; &#38;values_2=38397600,35487861,34803861,34510067&#38;<\/p><\/blockquote>\n<p>This text file is really what gives the flash chart it&#8217;s form, labels, and data.<\/p>\n<p>Again, this is quick and dirty implementation but it&#8217;s a life saver if you need something more than the charting in the platform.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>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&#8217;ve had: &#8211; 2 Pentaho Partners ask for the solution so they can start using it &#8211; 3 Community members ask [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[1],"tags":[],"_links":{"self":[{"href":"http:\/\/www.nicholasgoodman.com\/bt\/blog\/wp-json\/wp\/v2\/posts\/261"}],"collection":[{"href":"http:\/\/www.nicholasgoodman.com\/bt\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.nicholasgoodman.com\/bt\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.nicholasgoodman.com\/bt\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"http:\/\/www.nicholasgoodman.com\/bt\/blog\/wp-json\/wp\/v2\/comments?post=261"}],"version-history":[{"count":0,"href":"http:\/\/www.nicholasgoodman.com\/bt\/blog\/wp-json\/wp\/v2\/posts\/261\/revisions"}],"wp:attachment":[{"href":"http:\/\/www.nicholasgoodman.com\/bt\/blog\/wp-json\/wp\/v2\/media?parent=261"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.nicholasgoodman.com\/bt\/blog\/wp-json\/wp\/v2\/categories?post=261"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.nicholasgoodman.com\/bt\/blog\/wp-json\/wp\/v2\/tags?post=261"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}