Wednesday 30 March 2005 7:35:32 am
Hi again, This is the way I've done it with FusionCharts: 1. Put the .fla files under the design folder for you site (I've made a folder "charts" the same place where you finde "fonts", "images" and "stylesheets". 2. Make a class and one or more objects that can contain the data you want to show (f.ex. an indicator class). Save your data using the matrix attribute. 3. Make an override template for the class. Can look something like this:
<h1>{$node.name|wash}</h1>
{attribute_view_gui attribute=$node.data_map.description}
<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" WIDTH="570" HEIGHT="400" id="FusionCharts" ALIGN="">
<PARAM NAME=movie VALUE="/design/globalis/charts/FC_2_3_Column3D.swf?dataURL=/layout/set/trend/(object)/{$node.object.id}/&chartWidth=570&chartHeight=400">
<PARAM NAME=quality VALUE="high">
<PARAM NAME=bgcolor VALUE="#FFFFFF">
<EMBED src="/design/globalis/charts/FC_2_3_Column3D.swf?dataURL=/layout/set/trend/(object)/{$node.object.id}/&chartWidth=570&chartHeight=400" quality="high" bgcolor="#FFFFFF" WIDTH="570" HEIGHT="400" NAME="FusionCharts" ALIGN="" TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer"></EMBED>
</OBJECT>
{attribute_view_gui attribute=$node.data_map.data}
3. The chart-file (.fla) will fetch the XML-data from the pagelayout-file trend_pagelout (sending object id as a paramterer):
{let trend=fetch( 'content', 'object', hash( 'object_id', $view_parameters.object ) )}
<graph yAxisMinValue="15000" yAxisName="Millioner mennesker" showNames="1" showValues="1" rotateNames="1" showColumnShadow="1" animation="1" showAlternateHGridColor="1" AlternateHGridColor="ff5904" divLineColor="ff5904" divLineAlpha="20" alternateHGridAlpha="5" canvasBorderColor="666666" baseFontColor="666666" canvasBorderThickness="1" canvasBorderColor="000000">
{section loop=$trend.data_map.data.content.rows.sequential}
<set name="{$:item.columns.0}" value="{$:item.columns.1}" />
{/section}
</graph>
{/let}
4. You need to specify the new pagelayout in "layout.ini.append.php":
[trend]
PageLayout=trend_pagelayout.tpl
Here you can see the result:
http://globalis.fn.no/jordens_tilstand/befolkningseksplosjonen (under construction) There is a cache bug when sending parameters to a pagelayout-file. I'm trying to find the bug. Turn of cache while testing. Hope this helps!
http://blog.thematicmapping.org
http://www.globalis.no
|