Sign in to follow this  
santhu53

Linked Maps

Recommended Posts

Hi ,

 

I am trying to generate the linked maps but unsuccessful.Here is my code can anyone please tell where i went wrong

 

 

<html>

<head>

<title>Sample Map</title>

<?php

/*

We've included ../Includes/FusionCharts.js, which contains functions

to help us easily embed the Maps.

*/

include("Include/FusionCharts.php");

 

// We've included FusionCharts.js, which helps in

// easy map rendering.

?>

<script language="javascript" src="Include/FusionCharts.js"></script>

</head>

 

<body>

<?php

 

//include_once 'Include/FusionCharts.php';

 

$data = "<?xml version='1.0' encoding='UTF-8'?>";

$data = $data . "<map animation='1' showBevel='1' baseFontSize='9' fillAlpha='70' hoverColor='639ACE' borderColor='FFFFFF'>" ;

$data = $data . "<data>";

$data = $data . "<entity id='SA' value='515' link='newchart:FCMap_Brazil.swf-xml-SouthAmerica' />";

$data = $data . "</data>";

$data = $data . "<linkeddata id='SouthAmerica'>" ;

$data = $data . "<map borderColor='005879' fillColor='D7F4FF' includeValueInLabels='1' numberPrefix='$' baseFontSize='9' >" ;

$data = $data . "</map>" ;

$data = $data . "</linkeddata>" ;

$data = $data . "</map>";

 

FC_SetRenderer( "javascript" );

echo renderChartHTML("Include/FCMap_World.swf","",$data,"WorldMap", 800, 400);

?>

</body>

</html>

 

Thanks in advance

Share this post


Link to post
Share on other sites
Guest Sashibhusan

Hi,

 

Could you please replace the depricated method "renderChartHTML()" with "renderChart()" method of FusionCharts PHP API?

 

Your Code:

<?php
....
echo renderChartHTML("Include/FCMap_World.swf","",$data,"WorldMap", 800, 400);
?>

 

Modified to:

<?php
....
echo renderChart("Include/FCMap_World.swf","",$data,"WorldMap", 800, 400);
?>

 

Also, could you please confirm, whether you have "FCMap_Brazil.swf" file and corresponding JavaScript Map file "FusionCharts.HC.brazil.js" files in the same folder where "FusionCharts.js" file is present? (In your case "Include" folder of your application)

 

Since, you have "SouthAmerica" as linked map id, you might have included wrongly "FCMap_Brazil.swf" instead of "FCMap_SouthAmerica.swf". So, please modify your application accordingly and try once again.

 

Hope this helps!

Share this post


Link to post
Share on other sites

here is the modified code

 

<html>

<head>

 

<script LANGUAGE="Javascript" SRC="fusioncharts/FusionCharts.HC.australia.js"></SCRIPT>

<script LANGUAGE="Javascript" SRC="fusioncharts/FusionCharts.HC.world.js"></SCRIPT>

<script LANGUAGE="Javascript" SRC="fusioncharts/FusionCharts.HC.Maps.js"></SCRIPT>

 

</head>

<body>

<?php

 

 

include_once './fusioncharts/FusionCharts.php';

 

include_once './inc/common.php';

 

 

$data = "<?xml version='1.0' encoding='UTF-8'?>";

 

$data = $data . "<map borderColor='005879' fillColor='D7F4FF' includeValueInLabels='1' numberPrefix='$' baseFontSize='9'>";

 

$data = $data . "<data>";

$data = $data . " <entity id='NA' value='6921900' link='newchart:FCMap_NorthAmerica.swf-xml-NorthAmerica' />";

$data = $data . " <entity id='SA' value='3087120' link='newchart:FCMap_SouthAmerica.swf-xml-SouthAmerica' />";

$data = $data . " <entity id='AS' value='2434120' link='newchart:FCMap_Asia.swf-xml-Asia' />";

$data = $data . " <entity id='EU' value='5093230' link='newchart:FCMap_Europe.swf-xml-Europe' />";

$data = $data . " <entity id='AF' value='1032900' link='newchart:FCMap_Africa.swf-xml-Africa' />";

$data = $data . " <entity id='AU' value='3461230' link='newchart:FCMap_Australia.swf-xml-Australia' />";

$data = $data . "</data>";

$data = $data . "<linkeddata id='Australia'>";

$data = $data . "<map borderColor='005879' fillColor='D7F4FF' includeValueInLabels='1' numberPrefix='$' baseFontSize='9' >";

$data = $data . "<data>";

$data = $data . "<entity id='WA' value='200050' />";

$data = $data . "<entity id='NT' value='1509800' />";

$data = $data . "<entity id='QU' value='803480' />";

$data = $data . "<entity id='SA' value='123000' />";

$data = $data . "<entity id='SW' value='548000' />";

$data = $data . "<entity id='VI' value='182000' />";

$data = $data . "<entity id='TA' value='94900' />";

$data = $data . "</data>";

$data = $data . "</map>";

$data = $data . "</linkeddata>";

 

$data = $data . "<linkeddata id='NorthAmerica'>";

$data = $data . "<map borderColor='005879' fillColor='D7F4FF' includeValueInLabels='1' numberPrefix='$' baseFontSize='9' >";

$data = $data . "</map>";

$data = $data . "</linkeddata>";

$data = $data . "<linkeddata id='SouthAmerica'>";

$data = $data . "<map borderColor='005879' fillColor='D7F4FF' includeValueInLabels='1' numberPrefix='$' baseFontSize='9' >";

$data = $data . "</map>";

$data = $data . "</linkeddata>";

$data = $data . "<linkeddata id='Asia'>";

$data = $data . "<map borderColor='005879' fillColor='D7F4FF' includeValueInLabels='1' numberPrefix='$' baseFontSize='9' >";

$data = $data . "</map>";

$data = $data . "</linkeddata>";

$data = $data . "<linkeddata id='Europe'>";

$data = $data . "<map borderColor='005879' fillColor='D7F4FF' includeValueInLabels='1' numberPrefix='$' baseFontSize='9' >";

$data = $data . "</map>";

$data = $data . "</linkeddata>";

$data = $data . "<linkeddata id='Africa'>";

$data = $data . "<map borderColor='005879' fillColor='D7F4FF' includeValueInLabels='1' numberPrefix='$' baseFontSize='9' >";

$data = $data . "</map>";

$data = $data . "</linkeddata>";

 

$data = $data . "</map>";

 

FC_SetRenderer( "javascript" );

echo renderChartHTML("fusioncharts/FCMap_World.swf","",$data, "SalesMap", 750, 500);

?>

</body>

</html>

 

 

 

Hi,

 

Could you please replace the depricated method "renderChartHTML()" with "renderChart()" method of FusionCharts PHP API?

 

Your Code:

<?php
....
echo renderChartHTML("Include/FCMap_World.swf","",$data,"WorldMap", 800, 400);
?>

 

Modified to:

<?php
....
echo renderChart("Include/FCMap_World.swf","",$data,"WorldMap", 800, 400);
?>

 

Also, could you please confirm, whether you have "FCMap_Brazil.swf" file and corresponding JavaScript Map file "FusionCharts.HC.brazil.js" files in the same folder where "FusionCharts.js" file is present? (In your case "Include" folder of your application)

 

Since, you have "SouthAmerica" as linked map id, you might have included wrongly "FCMap_Brazil.swf" instead of "FCMap_SouthAmerica.swf". So, please modify your application accordingly and try once again.

 

Hope this helps!

Share this post


Link to post
Share on other sites
Guest Sashibhusan

Hi,

 

No need to link all the JavaScript files individually in the <script></script> tag.

 

You only need to include "FusionCharts.js" in <script> tag and rest all JavaScript files will automatically load by FusionCharts.js, whenever required.

 

You would just need to keep all the dependency JavaScript files in the same folder where your FusionCharts.js file is present.

 

Also, as I have already mentioned in the previous post, please use the latest "renderChart()" method as "renderChartHTML()" is deprecated FusionCharts XT PHP API.

 

Hope this helps!

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
Sign in to follow this