);"><OPTION value='5'>5<OPTION value='10'>10<OPTION value='20'>20<OPTION value='30'>30</SELECT> Customers</span> </FORM> </CENTER> <?php //Separator line echo drawSepLine(); ?> <table width='875' align='center' cellspacing='0' cellpadding='0'> <tr> <td align='center'> <?php $strXML = "<chart caption='" . $intYear . " - Top 5 Countries By Sales ' palette='" . getPalette() . "' animation='" . getAnimationState() . "' formatNumberScale='0' numberPrefix='\$' seriesNameInToolTip='0' sNumberSuffix=' pcs.' showValues='0' plotSpacePercent='0'>"; $strXML .= getSalesByCountryXML($intYear, 5, false, false); //Add some styles to increase caption font size $strXML .= "<styles><definition><style type='font' name='CaptionFont' size='15' color='" . getCaptionFontColor() . "' /><style type='font' name='SubCaptionFont' bold='0' /></definition><application><apply toObject='caption' styles='CaptionFont' /><apply toObject='SubCaption' styles='SubCaptionFont' /></application></styles>"; $strXML .= "</chart>"; echo renderChart("FusionCharts/MSColumn3DLineDY.swf", "", $strXML, "TopCountries", 750, 300, false, true); ?> </td> </tr> </table> <?php //Separator line echo drawSepLine(); ?> <CENTER>
$intYear = 1996; } else { $intYear = $_GET['year']; } //Render page headers echo render_pageHeader(); //Render the main table open echo render_pageTableOpen(); ?> <table width='875' align='center' cellspacing='0' cellpadding='0'> <tr> <td align='center'> <?php //Generate the XML data for the main pie chart. $strXML = "<chart caption='Sales By Country for " . $intYear . "' palette='" . getPalette() . "' animation='" . getAnimationState() . "' formatNumberScale='0' numberPrefix='\$' labeldisplay='ROTATE' slantLabels='1' seriesNameInToolTip='0' sNumberSuffix=' pcs.' showValues='0' plotSpacePercent='0'>"; $strXML .= getSalesByCountryXML($intYear, -1, true, false); //Add some styles to increase caption font size $strXML .= "<styles><definition><style type='font' name='CaptionFont' size='15' color='" . getCaptionFontColor() . "' /><style type='font' name='SubCaptionFont' bold='0' /></definition><application><apply toObject='caption' styles='CaptionFont' /><apply toObject='SubCaption' styles='SubCaptionFont' /></application></styles>"; $strXML .= "</chart>"; echo renderChart("FusionCharts/MSColumn3DLineDY.swf", "", $strXML, "NewChart", 850, 300, false, false); ?> </td> </tr> </table> <?php //Separator line echo drawSepLine(); ?>
<?php include "Includes/Connection_inc.php"; include "Includes/Functions.php"; include "DataGen.php"; //This method writes the top n countries and its sales quantity for a given year. //To this page, we're provided year and count $intYear = $_GET['year']; $count = $_GET['count']; //We do a conditional label formatting //If number of items to show on chart is less than 10, we wrap them //else we show as rotated if ($count > 10) { $labelFormatting = " labelDisplay='ROTATE' slantLabels='1' "; } else { $labelFormatting = " labelDisplay='WRAP' "; } //XML Data container $strXML = "<chart caption='" . $intYear . " - Top " . $count . " Countries By Sales ' palette='" . getPalette() . "' animation='" . getAnimationState() . "' formatNumberScale='0' numberPrefix='\$' labeldisplay='ROTATE' slantLabels='1' seriesNameInToolTip='0' sNumberSuffix=' pcs.' showValues='0' plotSpacePercent='0' " . $labelFormatting . ">"; $strXML .= getSalesByCountryXML($intYear, $count, false, true); //Add some styles to increase caption font size $strXML .= "<styles><definition><style type='font' name='CaptionFont' size='15' color='" . getCaptionFontColor() . "' /><style type='font' name='SubCaptionFont' bold='0' /></definition><application><apply toObject='caption' styles='CaptionFont' /><apply toObject='SubCaption' styles='SubCaptionFont' /></application></styles>"; $strXML .= "</chart>"; //Output it header('Content-type: text/xml'); echo $strXML;