|
Server : Apache/2.2.17 (Unix) mod_ssl/2.2.17 OpenSSL/0.9.8e-fips-rhel5 DAV/2 PHP/5.2.17 System : Linux localhost 2.6.18-419.el5 #1 SMP Fri Feb 24 22:47:42 UTC 2017 x86_64 User : nobody ( 99) PHP Version : 5.2.17 Disable Function : NONE Directory : /home/queenjbs/www/FusionChart/Code/MyFirstChart/ |
Upload File : |
<html>
<head>
<title>FusionCharts XT - My First Chart </title>
<link href="../assets/jquery.ui/jquery-ui.css" rel="stylesheet" type="text/css" />
<link rel="stylesheet" href="../assets/prettyPhoto/css/prettyPhoto.css" type="text/css" media="screen" charset="utf-8" />
<link href="../assets/ui/css/style.css" rel="stylesheet" type="text/css" />
<script src="../../Charts/jquery.min.js" type="text/javascript"></script>
<script src="../assets/jquery.ui/jquery-ui.min.js" type="text/javascript"></script>
<script src="../assets/prettyPhoto/js/jquery.prettyPhoto.js" type="text/javascript" charset="utf-8"></script>
<script type="text/javascript" src="../../Charts/FusionCharts.js"></script>
<script type="text/javascript"><!--
var dialog;
var COLUMNDATASERIES = true;
var FIRSTCOLUMNASHEADER = true;
var FIRSTROWASCATEGORIES = true;
$(document).ready(function() {
$('#prettyphoto-container').prettyPhoto({opacity: 0.35, showTitle: true, allowresize: false });
$('#showChart').click(function() {
var myChart = new FusionCharts( "../../Charts/MSColumn3D.swf", "myChartId1", "500", "400", "0", "1" );
myChart.setXMLData( getDataFromTable( COLUMNDATASERIES,FIRSTCOLUMNASHEADER,FIRSTROWASCATEGORIES ));
myChart.render("prettyphoto-container");
$.prettyPhoto.open("#prettyphoto-container",'FusionCharts in PrettyPhoto','FusionCharts XT');
});
function getDataFromTable(isColumnSeries, isFirstColHeader, isFirstRowCategories)
{
if(isFirstRowCategories)
var xml = "<chart caption='Yearly Sales Comparison'>";
if(isFirstRowCategories) {
xml += "<categories>";
var countC = 0;
$('#myHTMLTable tr:first td').each(function() {
countC++;
if(isFirstColHeader && countC==1)
xml += "";
else
xml += "<category label='"+($(this).text())+"' />";
} );
xml += "</categories>";
}
$('#myHTMLTable tr:gt(0)').each(function() {
var cCount=0;
xml += "<dataset ";
xml +="seriesName='"+$(this).find("td:first").text() +"' ";
xml += ">";
$(this).find("td:gt(0)").each(function() {
xml += "<set value='"+($(this).text())+"' />";
} );
xml += "</dataset>";
});
xml += "</chart>";
return xml;
}
});
// --></script>
<!--[if IE 6]>
<script type="text/javascript" src="../assets/ui/js/DD_belatedPNG_0.0.8a-min.js"></script>
<script>
/* select the element name, css selector, background etc */
DD_belatedPNG.fix('img');
/* string argument can be any CSS selector */
</script>
<![endif]-->
<style type="text/css">
h2.headline {
font: normal 110%/137.5% "Trebuchet MS", Arial, Helvetica, sans-serif;
padding: 0;
margin: 25px 0 25px 0;
color: #7d7c8b;
text-align: center;
}
p.small {
font: normal 68.75%/150% Verdana, Geneva, sans-serif;
color: #919191;
padding: 0;
margin: 0 auto;
width: 664px;
text-align: center;
}
#prettyphoto-container {
display: none;
height: 400px;
width: 550px;
}
.headerbg, .headerbg td , .headerbg th{ background-color:#D0CBE1; color:#000 !important;}
</style>
</head>
<body>
<div id="wrapper">
<div id="header">
<div class="logo"><a class="imagelink" href="http://www.fusioncharts.com/" target="_blank"><img src="../assets/ui/images/fusionchartsv3.2-logo.png" width="131" height="75" alt="FusionCharts XT logo" /></a></div>
<h1 class="brand-name">FusionCharts XT</h1>
<h1 class="logo-text">My First chart - Display FusionChart in a prettyPhoto LightBox</h1>
</div>
<div class="content-area">
<div id="content-area-inner-main">
<p class="text" align="center">Click the button below the table to create a chart (in a light-box) showing the data present in the table</p>
<div id="messageBox" style="margin-left:10px; margin-right:10px; display:none;"></div>
<p> </p>
<div class="gen-chart-render">
<table class="table" id="myHTMLTable" border="0" align="center" cellpadding="5" cellspacing="0">
<tr class="headerbg">
<td> </td>
<td><strong>January</strong></td>
<td><strong>February</strong></td>
<td><strong>March</strong></td>
<td><strong>April</strong></td>
<td><strong>May</strong></td>
<td><strong>June</strong></td>
<td><strong>July</strong></td>
<td><strong>August</strong></td>
<td><strong>September</strong></td>
<td><strong>October</strong></td>
<td><strong>November</strong></td>
<td><strong>December</strong></td>
</tr>
<tr>
<td class="headerbg"><strong>Product A</strong></td>
<td align="right">27400</td>
<td align="right">24500</td>
<td align="right">23200</td>
<td align="right">26700</td>
<td align="right">26200</td>
<td align="right">27800</td>
<td align="right">21200</td>
<td align="right">23400</td>
<td align="right">29400</td>
<td align="right">23500</td>
<td align="right">25500</td>
<td align="right">27500</td>
</tr>
<tr>
<td class="headerbg"><strong>Product B </strong></td>
<td align="right">10000</td>
<td align="right">14500</td>
<td align="right">13200</td>
<td align="right">14500</td>
<td align="right">13800</td>
<td align="right">14500</td>
<td align="right">12900</td>
<td align="right">15100</td>
<td align="right">14900</td>
<td align="right">21000</td>
<td align="right">15600</td>
<td align="right">17100</td>
</tr>
</table>
<div id="prettyphoto-container">FusionCharts will load here</div><br/>
<p align="center"><button id ="showChart">Create Chart with the above data</button> </p>
</div>
<div class="clear"></div>
<p> </p>
<p class="small"> </p>
<div class="underline-dull"></div>
</div>
</div>
<div id="footer">
<ul>
<li><a href="index.html"><span>« Back to list of examples</span></a></li>
<li class="pipe">|</li>
<li><a href="../NoChart.html"><span>Unable to see the chart above?</span></a></li>
</ul>
</div>
</div>
</body>
</html>