Question

I have problem with fusioncharts, I use PHP and JavaScript. Here are code:

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

Problem is fusioncharts on iOS, Android and other mobile devices can't load chart?

Was it helpful?

Solution

The code seems to be perfect and your problem can be because of one of the following-

1) Some of the .js files are missing or not in the same folder.

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

2) The path provided is wrong.

3) iPhone, iPad, iTouch, Android(>Honeycomb) etc. use flash- check out the documentation for explicit rendering in JavaScript mode.

http://www.fusioncharts.com/dev/usage-guide/getting-started/your-first-charts/building-your-first-chart.html can be used for reference.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top