dantodor

FC and Flex

Recommended Posts

Hi there!

 

 

 

Just a short question : has someone integrated an FC chart in a Flex application ?

 

I just found this site, I think it's one of the best product that money can buy for charting, but I don't seem to be able to integrate it in our current approach. The issue I'm facing is that when I'm adding a chart to a panel ( via an SWFLoader object ), until certain dimensions of the container panel, nothing shows, after those dimensional constraints are met, the chart is added to the display, but it takes over the whole visible area. Any ideas why this happens ?

 

TIA!

 

 

 

All best,

 

Dan

Share this post


Link to post
Share on other sites

Hi,

Can you please try with the attached chart once? While loading this SWF, just make sure to specify the chartWidth and chartHeight variables as under:

load("Pie3D.swf?chartWidth=xxx&chartHeight=yyy")

Share this post


Link to post
Share on other sites

From my current experience, it works, but you have to find, for each chart, the cobination between the height and the width of the panel you're adding the swf loader and the dimensions of the swf loader itself, and it's only by trial and error so far, and it's connected to each chart in part, I wasn't able / didn't have time to search for a generic rule yet. By example:

 


< mx : Panel x="10" y="10" width="600" height="330" title="Graphic One">

       < mx : SWFLoader id="Pie" width="500" height="120" source="Pie3D.swf?dataURL=Pie3D.xml"/>

< /mx : Panel>

 

 

 

works for me. I suspect that's somehow related to the initial aspect ratio of each graph.

Edited by Guest

Share this post


Link to post
Share on other sites

Thanks for the fast reply!

 

 

 

I am actually using the following code and the map shows up fine:

 

 

 

< mx : Panel width="100%" height="100%" >

 

< mx : Canvas label="ChartCanvas" width="100%" height="100%" >

 

< mx : SWFLoader x="0" y="0" width="100%" height="100%" scaleContent="true" autoLoad="true" id="MyChart" source="@Embed(source='DragNode.swf')">

 

< /mx : SWFLoader>

 

< /mx : Canvas>

 

< /mx : Panel>

 

 

 

What I would like to see is ActionScript sample code on how to reference and load XML data into this chart at run time.

 

 

 

Best regards.

 

 

 

--Antonio

Edited by Guest

Share this post


Link to post
Share on other sites

You have two approaches :

 

- add the xml name after the question mark, like in the previous example;

 

- use the following function:

 


   function setVars ( event:Event ):void {

       event.target.content.dataURL = "Data.xml";

   }

 

and call it in the 'complete' event on the loader. The issue with setVars is that is sets the dataURL, but cannot set other params, didn't experimented too much. However, all the important stuff is in xml, so you're safe :)

 

 

 

hth

Share this post


Link to post
Share on other sites

Hi, thank you for the code but this doesn't work for me unfortunately:

 

 

 

 

 

 

 

function setVars ( event:Event ):void {

 

event.target.content.dataURL = "DragNode1.xml";

 

}

 

 

 

 

 

< mx : SWFLoader x="0" y="0" width="100%" height="100%" scaleContent="true" autoLoad="true" id="MyChart" source="@Embed(source='DragNode.swf')" complete="setVars(event);" />

 

 

 

 

 

 

 

 

 

Thank you anyway for your help. I hope the people at FC provide us with some sample code we can use.

 

 

 

best regards,

 

 

 

--Antonio

Edited by Guest

Share this post


Link to post
Share on other sites

I figured I would add some notes and restart the conversation to see if Fusion Charts has any support or product roadmap comments to add. We were looking for some flash style displays and settled on Fusion Charts, however when the part of the project we needed it for went in a Flex based direction we had problems and ended up dropping use of and not licensing FC. It is unfortunate because I think they have a nice and extensive set of visualization components with good licensing terms.

 

 

 

We ran into the sizing issues at first which was a real headache to trial and error adjust all kinds of sizing parameters (SWFLoader, in the FC xml, in the FC url, etc). But then a worse problem showed up where we had 5 gauges in a Flex based screen via SWFLoader and odd stuff started happening with HTTPService. We had onclick events on the SWFLoader which would allow us to load various xml via HTTPService when a user clicked on a specific gauge and when running over a fairly low latency normal internet connection as opposed to a local 100MB LAN the HTTP calls became totally unstable. It was strange and took awhile to realize it was related to SWFLoader somehow.

 

 

 

I suspect it probably is more of an Adobe issue with SWFLoader than an FC issue, but the fact remains that using old SWF in Flex apps is unreliable and not very well supported in my opinion. I hope FC plans to put out some native Flex components (SWC) or maybe Flash 9 SWF which I think might work better. In the meantime it looks like we are going to have to hire someone to create AS3 code for the couple of most important visualizations we need right away.

Share this post


Link to post
Share on other sites

Hi,

 

 

 

I'm trying to use FusionCharts with Flex using the SWFLoader. When I load one chart it works fine, but when I try loading two charts both are drawn partially. Is this possible with FusionCharts?

 

 

 

My test code is the following:

 

 

 

//-----------------------------------------------------------------------------------

 

 

 

// The container for the two panels with the two charts.

 

hbox = new HBox();

 

 

 

// The first chart.

 

panel1 = new Panel();

 

swfLoader1 = new SWFLoader();

 

swfLoader1.id = "chart1";

 

swfLoader1.source =

 

"FCF_Line.swf

 

?noCache=1

 

&id=1

 

&chartWidth=400

 

&chartHeight=300

 

&dataXML=

 

 

 

 

";

 

 

 

panel1.addChild(swfLoader1);

 

 

 

// The second chart.

 

panel2 = new Panel();

 

swfLoader2 = new SWFLoader();

 

swfLoader1.id = "chart2";

 

swfLoader2.source =

 

"FCF_Line.swf

 

?noCache=2

 

&id=2

 

&chartWidth=400

 

&chartHeight=300

 

&dataXML=

 

 

 

 

";

 

 

 

panel2.addChild(swfLoader2);

 

 

 

hbox.addChild(panel1);

 

hbox.addChild(panel2);

 

 

 

Application.application.addChild(hbox);

 

 

 

//-----------------------------------------------------------------------------------

 

 

 

Thank you,

 

Gabriel

Share this post


Link to post
Share on other sites

Hi,

 

If you have the chart code, change some portion of the 'Init.as' file (location: com>fusioncharts>includes) as shown below, and recompile.

 

//Get chart width and height

var _chartWidth : Number =

Number (rootAttr ["chartwidth"]);

var _chartHeight : Number =

Number (rootAttr ["chartheight"]);

//If chart width and chart height

have registered as 0, we update

to Flashvars value

if (_chartWidth == 0 || _chartHeight == 0)

{

_chartWidth = Stage.width;

_chartHeight = Stage.height;

}

 

 

For the mxml do the following:

 

mySWFloader.source="MSLine.swf?chartwidth=600&chartheight=400"

you can also set XML data like

mySWFloader.source="MSLine.swf?chartwidth=600&chartheight=400&dataURL=your_xml.xml"

 

Share this post


Link to post
Share on other sites

We've (finally) released the beta of FusionCharts for Flex. You can see it and download from http://www.fusioncharts.com/flex/ . The download contains source code of both our demo applications - Chart Explorer and Mortgage, which can also be seen online at http://www.fusioncharts.com/flex/Demos.asp

 

 

 

Your feedback is VERY important to us and as such please do let us know what you think of this and also if you face any bugs.

Share this post


Link to post
Share on other sites
Guest Rajroop

Hello :),

 

 

 

We are really excited to announce the release of FusionCharts for Flex v1.1 featuring the following:

 

 

 

- 12 new chart types: 7 new gauges including Angular gauge, LED gauge and Linear gauge, Spark chart and Bullet graphs have been added.

 

- All the gauges can fetch data in real-time and come with alert managers and message loggers.

 

- All the charts and gauges can now be natively exported as images and PDFs.

 

- The data for all the charts can be exported as CSV.

 

- Data sets can now have custom text labels instead of numeric values.

 

- The charts can handle a lot more events to help you manipulate them better.

 

- Trendlines can also have custom tool-text.

 

- Custom color palettes can be defined for the data plots.

 

 

 

Learn more about it from www.fusioncharts.com/flex and learn more on whats new from http://www.fusioncharts.com/flex/VersionHistory.asp.

 

 

 

Existing customers can upgrade to the new version from www.fusioncharts.com/PUC.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now