Search for:
Jump to: 
Your Ad Here
Post new topic Reply to topic
Author Message
 Post subject: How to create a bar charts
PostPosted: Tue Jul 08, 2008 3:16 am 
Offline

Joined: Tue May 13, 2008 3:43 am
Posts: 213
<?php

//We've included ../Includes/FusionCharts_Gen.php, which contains FusionCharts PHP Class
//to help us easily embed the charts.

include("../Includes/FusionCharts_Gen.php");
?>
<HTML>
<HEAD>
<TITLE>
Simple Column 3D Chart
</TITLE>

<?php
//You need to include the following JS file, if you intend to embed the chart using JavaScript.

//Embedding using JavaScripts avoids the "Click to Activate..." issue in Internet Explorer

//When you make your own charts, make sure that the path to this JS file is correct.

//Else, you would get JavaScript errors.
?>
<SCRIPT LANGUAGE="Javascript" SRC="../../FusionCharts/FusionCharts.js"></SCRIPT>
</HEAD>

<BODY>

<?php
//This page demonstrates the ease of generating charts using Charts PHP Class.

//For this chart, we've created an instance of Charts PHP Class,

//fed chart data and configuration parameters to it and rendered chart using the instance.

//Here, we've kept this example very simple.

# Create object for Column 3D chart
$FC = new FusionCharts("Column3D","650","300");

# Setting Relative Path of chart swf file.
$FC->setSwfPath("../../FusionCharts/");

# Store chart attributes in a variable
$strParam="caption=Score Board;xAxisName=Players;yAxisName=Runs;decimalPrecision=0; formatNumberScale=0";

# Set chart attributes
$FC->setChartParams($strParam);
# Add chart data along with category names
$FC->addChartData("99","name=Sachin");
$FC->addChartData("60","name=Ganguly");
$FC->addChartData("71","name=Dravid");
$FC->addChartData("94","name=Dhoni");
$FC->addChartData("61","name=Yuvraj");
$FC->addChartData("60","name=Sehwag");
$FC->addChartData("29","name=Pathan");
$FC->addChartData("22","name=Sreesanth");
$FC->addChartData("36","name=Kartheek");
$FC->addChartData("4","name=Zaheer");
$FC->addChartData("7","name=Kumble");

?>

<?
# Render chart
$FC->renderChart();

?>
</BODY>
</HTML>

About website
-----------------
1) The best site for the php/swf charts is http://www.fusioncharts/free
In this we have the data about all types of charts and in this site we have good examples
2) We can download the php charts from the following site
http://www.fusioncharts.com/free/Downlo ... nuItemId=5
3)To find more examples in charts
http://www.fusioncharts.com/free/Galler ... nuItemId=3


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic    [ 1 post ] 

1, 2, 3, 4, 5 ... 413
Recent topics  Replies   Views   Last post 
No new posts How to Convert DVD and Video to Your iphone 4,iphone 4 to pc

by smsbackuper » Wed May 18, 2011 8:11 am in PHP-Code Help

2

1437

Thu May 23, 2013 6:39 am

greenwoove View the latest post

No new posts Jquery ajax Pagination using php

by rajkumar » Tue Apr 19, 2011 11:14 am in Coding Repository

8

17622

Mon May 20, 2013 2:46 am

gfsdfg View the latest post

No new posts How to upgrade and migrate Joomal site

by mallikharjuna rao » Mon Jan 21, 2013 1:40 pm in Joomla

1

368

Thu May 16, 2013 9:53 am

sunitha12 View the latest post

No new posts Benefits of PHP

by hirephpexpert » Fri Sep 07, 2012 4:41 am in CakePHP

6

1608

Wed May 15, 2013 6:25 am

PrettyPrincesG View the latest post

No new posts How to stop user from getting registered in Joomla

by mallikharjuna rao » Tue Jan 22, 2013 5:16 am in Joomla

3

1593

Wed May 15, 2013 6:17 am

PrettyPrincesG View the latest post


Your Ad Here