Sign in to follow this  
dontspeak

Some String Chracters Not Display In Fusion Pie Chart

Recommended Posts

Hi ,I'm join this forum because I'm using fusion charts which is the world no one chart in the world..I'm really happy to use these charts... Friends I have Little bit a problem with pie chart....

i'm parsing my MySQL data base data to fusion chart code & draw a pie chart...but unfortunately some characters are not displays..please help to recover this problem...

here is my code:

 

<?php

include("FusionCharts/FusionCharts.php");

include("special_db_connect.php");

?>

<HTML>

<HEAD>

<TITLE>

Exam Result Analysis

</TITLE>

<?php

?>

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

<style type="text/css">

<!--

body {

font-family: Arial, Helvetica, sans-serif;

font-size: 12px;

}

.text{

font-family: Arial, Helvetica, sans-serif;

font-size: 12px;

}

-->

</style>

</HEAD>

<BODY>

<CENTER>

<?php

// Connect to the DB

$link = connectToDB();

//Generate the chart element

$strXML = "<chart caption='Academic year 2010/2011 results' subCaption='By Grades' pieSliceDepth='30' showBorder='1' formatNumberScale='0' numberSuffix=' Students'>";

// Fetch all factory records

$strQuery = "SELECT grade, COUNT(*) 'No_Of_grades' FROM std_results WHERE course_code ='CSC113A' GROUP BY grade";

$result = mysql_query($strQuery) or die(mysql_error());

//Iterate through each factory

if ($result) {

while($ors = mysql_fetch_array($result)) {

//Generate <set label='..' value='..' />

$strXML .= "<set label='" . $ors['grade'] . "' value='" . $ors['No_Of_grades'] . "' />";

}

}

//Finally, close <chart> element

$strXML .= "</chart>";

//Create the chart - Pie 3D Chart with data from $strXML

echo renderChart("FusionCharts/Pie3D.swf", "", $strXML, "Results", 600, 300, false, false);

echo "</br></br>";

mysql_close($link);

?>

</CENTER>

</BODY>

</HTML>

 

Out put Pie Chart :

0knwC.jpg

 

This is above my code {$strQuery = "SELECT grade, COUNT(*) 'No_Of_grades' FROM std_results WHERE course_code ='CSC113A' GROUP BY grade";} :result of this code in phpmyadmin :

zGIuX.png

 

Actually this table value will parse to the pie chart..here u can see in grade column A+,C+ values...problem is those string's are not displays in the pie chart.{please visit above pie chart image}.Actually A+ & C+ display without '+' character.{but '-',C-,A- character displays}..It's a problem for me..How can I fix this problem...{Remind Above code is working perfectly..no problem about that only problem is not displaying '+' character .}

Edited by dontspeak

Share this post


Link to post
Share on other sites
Guest Sashibhusan

Hi,

 

Could you please confirm once, whether the '+' character is retrieved from the database in your PHP code by echoing the value as below?

 

Ref. Code:

<?php
....
while($ors = mysql_fetch_array($result)) {
//Generate <set label='..' value='..' />
//$strXML .= "<set label='" . $ors['grade'] . "' value='" . $ors['No_Of_grades'] . "' />";
echo "Grades :" . $ors['grade'] . "</br>";
}

....

//echo renderChart("FusionCharts/Pie3D.swf", "", $strXML, "Results", 600, 300, false, false);
?>

 

Awaiting your response!

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