FusionCharts uses JavaScript to render the iPhone/iPod/iPad chart

Recommended for you: Get network issues from WhatsUp Gold. Not end users.

FusionCharts using JavaScript:

FusionCharts allows users to create JavaScript diagrams (also known as web on the HTML5 /Canvas chart). This feature allows the user to create a chart in Flash viewer does not support web browser, such as iPhone / iPad. FusionCharts using Highcharts library to generate JavaScript diagrams.

 

This function can be seamlessly with the current FusionCharts implementation mode. Not to need any extra code. JavaScript type automatic detection of FusionCharts does not support Flash equipment, and create a JavaScript diagram. You can ignore Flash, and only use JavaScript to generate the chart.

How FusionCharts works:

FusionCharts XT provides a new FusionCharts class JavaScript. FusionCharts JavaScript now includes four main file: FusionCharts.js, FusionCharts.HC.js, FusionCharts.HC.Charts.js and jquery.min.js. These four files in Download Pack > Charts folder.

The user may only need in web pages include FusionCharts.js (at the time, attention, also need to copy the file to your web application). The rest of the JavaScript file will be automatically loaded on demand by FusionCharts.js.

Once the FusionCharts determined that there is no available Flash player equipment, it will automatically switch the blending mode to JavaScript. If you want the JavaScript to render the chart as the default, also can be set by code.

Let us have a look are available in Flash and JavaScript rendering of the circumstances, only the JavaScript rendering effective code:

<html>
 <head>
  <title>My First chart using FusionCharts - Using JavaScript</title>
  <script type="text/javascript" src="FusionCharts/FusionCharts.js"></script>
 </head>
 <body>
  <div id="chartContainer">FusionCharts will load here!</div>
  <script type="text/javascript"><!--
     var myChart = new FusionCharts("FusionCharts/Column2D.swf", "myChartId", "400",
                                    "300", "0", "1" );
     myChart.setXMLUrl("Data.xml");
     myChart.render("chartContainer");
  // -->
  </script>
 </body>
</html>

 

 

 

 

Specifies the JavaScript rendering graphics:

If only to render the JavaScript chart of hope, then use the following code:

 

 

FusionCharts.setCurrentRenderer('javascript')

 

This code causes the FusionCharts renderer to skip the Flash rendering and to create a pure JavaScript chart.

This setting can be applied to all rendering chart. Therefore, if a began to use all the charts, the page will use JavaScript for rendering. Users without the need for each chart page are set individually.

The modified code is as follows:

<html>
  <head>     
    <title>My First chart using FusionCharts - Using pure JavaScript</title>     
    <script type="text/javascript" src="FusionCharts/FusionCharts.js"></script>
  </head>
  <body>     
    <div id="chartContainer">FusionCharts will load here!</div>          
    <script type="text/javascript"><!--
      FusionCharts.setCurrentRenderer('javascript');
      var myChart = new FusionCharts( "FusionCharts/Column2D.swf", "myChartId", "400",
                                      "300", "0", "1" );
      myChart.setXMLUrl("Data.xml");
      myChart.render("chartContainer");
    // -->  
    </script>        
  </body> 
</html>

 

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download

Posted by Michell at December 03, 2013 - 11:06 PM