0

我对 fusioncharts 有问题,我使用 PHP 和 JavaScript。这里是代码:

<div id="chartdiv_krpb" class="chartdiv_krpb"></div>
<script type="text/javascript">
    var myChart;
    myChart = new FusionCharts("swf/Pie2D.swf", "myChart_krpb", "100%", "240", "0", "1");
    myChart.setDataURL("data/krpb.php?thnang=<? echo $thnang; ?>");
    myChart.render("chartdiv_krpb");
</script>

krpb.php

$sql = mysql_query("SELECT acronym AS 'KODE', SUM(RPHREAL) AS RPHREAL FROM t_sai LEFT JOIN rosi_chat.t_perk2 ON kdperk2 = LEFT(PERKSAI, 2) WHERE THNANG = '$thnang' AND RPHREAL > 0 AND t_perk2.kdtrn = '3' AND kdkem = '0' AND kdperk2 IN ('51','52', '53', '57') GROUP BY kdperk2") or die(mysql_error());

$strXML = "<chart pieRadius='90' showPercentageValues='1' showValues='1' numberScaleValue='1000,1000,1000,1000' numberScaleUnit=' K, J, M, T' formatNumberScale='1' animation='0' numdivlines='3' baseFontSize='9' baseFontColor='000000'  showBorder='0'  caption='Realization' bgColor='7A864E' bgAlpha='50,75' bgRatio='75' bgAngle='270' canvasBgColor='A7AB50' canvasBgAlpha='50,75' canvasBgRatio='75' canvasBgAngle='270' canvasBorderThickness='0'>";
while ($record = mysql_fetch_array($sql)) {
    $strData .= "<set label='" . $record['CODE'] . "' value='" . $record['RPHREAL'] . "' />";
}
$strXML .=  $strData . "</chart>";
echo $strXML;

问题是 iOS、Android 等移动设备上的 fusioncharts 无法加载图表?

4

1 回答 1

1

该代码似乎很完美,您的问题可能是由于以下原因之一 -

1) 某些 .js 文件丢失或不在同一文件夹中。

http://docs.fusioncharts.com/charts/contents/Introduction/DownloadC.html

2) 提供的路径错误。

3) iPhone、iPad、iTouch、Android(>Honeycomb) 等使用 flash——查看文档以了解 JavaScript 模式下的显式渲染。

http://www.fusioncharts.com/dev/usage-guide/getting-started/your-first-charts/building-your-first-chart.html可以参考。

于 2013-07-02T05:14:27.700 回答