clandestino_bgd

Javascript Rendering

Recommended Posts

Hi,

first and foremost, apologies for probably very stupid question, but this is my Day#1 with FusionCharts.

So:

Looking at the example from tutorial,

<script type="text/javascript"><!--

     [b]FusionCharts.setCurrentRenderer('javascript');[/b]

     var myChart = new FusionCharts( "FusionCharts/Column3D.swf", 
                   "myChartId", "400", "300", "0", "1" );

     myChart.setXMLUrl("Data.xml");

      myChart.render("chartContainer");

   // -->  
   </script>  

 

I am failing to understand, why you need to reference swf file at all, if you are using javascript renderer.

 

Thanks for your patience and clarification in advance,

best,

Milan

Share this post


Link to post
Share on other sites
Guest Angshu

Hi,

 

Welcome to FusionCharts Forum! smile.gif

 

To create a chart, you need the following 4 items:

1. Chart SWF files : Each chart in FusionCharts is an SWF file that creates a specific type of chart. So, if you want to create 3D column chart, you'll need the SWF file called Column3D.swf. Similarly for creating a 3D pie chart you'll need Pie3D.swf. The chart SWF file is loaded and rendered using Adobe Flash player plug-in that is installed on your machine (more specifically, browser).

 

Hence, without the swf file, you will not be able to render your chart, whether you are using Flash or JavaScript renderer.

 

2. Chart data : FusionCharts data file contains both data for plotting, and cosmetic/functional configuration for the chart. FusionCharts accepts data in XML and JSON format. The XML or JSON data document can either be produced manually or generated using server-side scripts that are connected to your databases or live data sources. In the above example, we have used a hand-coded XML file for plotting the chart.

 

3. JavaScript class files : These are also present in the Charts folder in the root of the Download Package. The JavaScript class files help in embedding the chart SWF files into a web page, and also help in rendering JavaScript (HTML5) fallback charts. Additionally, it provides a JavaScript interface for controlling the chart.

 

4. HTML wrapper file (or a dynamic web page): The HTML wrapper file is where the charts are rendered. This file contains the code which integrates all other components (discussed above) to produce the charts.

 

Hope this helps.

Share this post


Link to post
Share on other sites

Hi Angshu,

thanks for reply, but I am still missing something.

 

The chart SWF file is loaded and rendered using Adobe Flash player plug-in that is installed on your machine (more specifically, browser).

Hence, without the swf file, you will not be able to render your chart, whether you are using Flash or JavaScript renderer.

 

I understand I need swf file in any case, but my question is why?

If I I am using javascript renderer, why would I need swf at all?

I'd expect that chart implementation is in JS in that case, not in swf.

 

Thanks,

MIlan

Share this post


Link to post
Share on other sites

Hi Angshu,

I had the same question as Milan. Why is a SWF file required when using the JavaScript renderer? There is no Adobe Flash player on an iPad so why would the SWF file still be required?

 

Thanks.

Rich

Share this post


Link to post
Share on other sites

I have the same question. It makes no sense to necessitate a swf if you only want to do the rendering via javascript. We are developing for iPad/iPhone and Android and we do not want to use the swfs even in Android. In our tests, the js has more crisp text in the charts than the swf. Please clarify why we cannot bypass the swf.

 

Thank you,

- BB

Edited by bbuie

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