fusionchart for iphone with svg

1.让你的fusionchart以svg的形式跑在未安装flash的浏览器上
How do I render charts using JavaScript (without Flash) & in iPhone/iPod/iPad?
FusionCharts using JavaScript :
FusionCharts XT allows you to create JavaScript based charts (sometimes also referred to as HTML5/Canvas charts on the web). This feature allows you to create charts in web browsers where Flash Player is not supported e.g. in iPhone/iPad. FusionCharts internally makes use of Highcharts library to generate JavaScript based charts.

This feature works seamlessly with the current implementation mode of FusionCharts i.e., you do not need to write any additional code to implement this. FusionCharts.js JavaScript class automatically detects devices where Flash is not supported and renders JavaScript based charts instead. You can also ignore Flash and only use JavaScript for charting.

How it Works?
FusionCharts XT features a completely new FusionCharts JavaScript class. FusionCharts JavaScript class now consists of four main files: FusionCharts.js, FusionCharts.HC.js, FusionCharts.HC.Charts.js and jquery.min.js. These four files are present in Download Pack > Charts folder.

You would only need to include FusionCharts.js in your web page (however, do not forget to copy the rest of files to your web application). The rest of the JavaScript files will be automatically loaded on-demand by FusionCharts.js.
Once FusionCharts class determines that Flash player is not available in the device, it automatically switches the rendering mode to JavaScript. If you wish to render the chart as JavaScript by default, you can do this by setting the rendering method to JavaScript from your code.

Let's look at code where both Flash and JavaScript rendering is enabled, with JavaScript rendering only coming into effect where Flash Player is not available:

<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>


Explicitly render JavaScript only charts :

If you wish to render JavaScript charts only, you just have to add a line of code as shown below:

FusionCharts.setCurrentRenderer('javascript')
This code will ask FusionCharts renderer to skip Flash rendering and create pure JavaScript charts.

This setting gets applied to all the charts rendered after this line. Hence, if you declare this at the beginning, all the charts in the page will rendered using JavaScript. You would not need to declare the same for each chart in the page.
The modified code will look like the following:

<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>

fusionchart上要跑仪表盘,记得添加FusionWidgets XT下的FusionCharts.HC.Widgets.js
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值