Moderators joeri Posted July 22, 2012 Moderators Report Share Posted July 22, 2012 hello all i am stuck again building a new template i need to change the width of the finance charts and stuff i alterd every code i found related to that but it keeps the samle width as you seen in the picture the chart is smaller but the black sheet stays large regards joeri Quote Link to comment Share on other sites More sharing options...
vader21 Posted July 22, 2012 Report Share Posted July 22, 2012 Can you place the code here? Quote Link to comment Share on other sites More sharing options...
Colin Posted July 22, 2012 Report Share Posted July 22, 2012 Hiya Joeri all I did was change the finance Summary sheet, for mine I used $chart_width = '600'; $chart_height = '500'; Quote Link to comment Share on other sites More sharing options...
Colin Posted July 22, 2012 Report Share Posted July 22, 2012 Additionally I found changing the finance_balancesheet.tpl didn't actually do anything it was only when I changed the summary sheet that the chart resized Quote Link to comment Share on other sites More sharing options...
Moderators joeri Posted July 22, 2012 Author Moderators Report Share Posted July 22, 2012 thats not working the bearkdonw is working perfect but its only the top one that i just cant make smaller Quote Link to comment Share on other sites More sharing options...
tutmeister Posted July 23, 2012 Report Share Posted July 23, 2012 In the template is the object HTML for the breakdown flash chart, like so: <object width="700" height="450" data="http://www.unityvirtual.net/lib/js/ofc/open-flash-chart.swf" type="application/x-shockwave-flash"> <param name="flashvars" value="data-file=http://www.unityvirtual.net/action.php/finances/viewmonthchart?"> </object> Have you changed the width and height accordingly? If not, it will overrule any CSS and may be your problem. For the Balance Sheet, you'll need to edit the HTML as it is also hard-coded in the table properties. Quote Link to comment Share on other sites More sharing options...
Moderators joeri Posted July 23, 2012 Author Moderators Report Share Posted July 23, 2012 in my finance_summarysheet.tpl i have the following standard code <?php /* * DO NOT EDIT THIS TEMPLATE UNLESS: * 1. YOU HAVE ALOT OF TIME * 2. YOU DON'T MIND LOSING SOME HAIR * 3. YOU HAVE BIG BALLS MADE OF STEEL * * It can cause incontinence * * YOU HAVE BEEN WARNED!!! */ ?><?php Template::Show('finance_header.tpl'); ?> <h3><?php echo $title?></h3> <?php $total = 0; $profit = array(); $pilot_pay = array(); $revenue = array(); $expenses = array(); $flightexpenses = array(); $fuelexpenses = array(); $months=array(); ?> <table width="500px" align="center" class="balancesheet" cellpadding="0" cellspacing="0"> <tr class="balancesheet_header" style="text-align: center"> <td width="" align="left">Month</td> <td width="" align="center">Flights</td> <td width="" align="left">Revenue</td> <td width="" align="center" nowrap>Pilot Pay</td> <td width="" align="left">Expenses</td> <td width="" align="left">Fuel</td> <td width="" align="center">Total</td> </tr> <?php echo '<pre>'; //print_r($allfinances); echo '</pre>'; foreach ($allfinances as $month) { ?> <tr> <td align="right"> <?php echo $month->ym; ?> </td> <td align="center"> <?php echo $month->total; ?> </td> <td align="right" nowrap> <?php echo FinanceData::FormatMoney($month->gross); ?> </td> <td align="right" nowrap> <?php echo FinanceData::FormatMoney(-1 * $month->pilotpay); ?> </td> <td align="right" nowrap> <?php echo FinanceData::FormatMoney((-1) * $month->expenses_total); ?> </td> <td align="right" nowrap> <?php echo FinanceData::FormatMoney((-1) * $month->fuelprice); ?> </td> <td align="right" nowrap> <?php $profit[] = round($month->revenue, 2); $total += $month->revenue; echo FinanceData::FormatMoney($month->revenue); ?> </td> </tr> <?php } ?> <tr class="balancesheet_header" style="border-bottom: 1px dotted"> <td align="" colspan="8" style="padding: 1px;"></td> </tr> <tr> <td align="right" colspan="6"><strong>Total:</strong></td> <td align="right" colspan="2"><strong><?php echo FinanceData::FormatMoney($total);?></strong></td> </tr> </table> <h3>Breakdown</h3> <div align="center"> <?php /* Added in 2.0! */ $chart_width = '500'; $chart_height = '500'; /* Don't need to change anything below this here */ ?> <div align="center" style="width: 100%;"> <div align="center" id="summary_chart"></div> </div> <script type="text/javascript" src="<?php echo fileurl('/lib/js/ofc/js/json/json2.js')?>"></script> <script type="text/javascript" src="<?php echo fileurl('/lib/js/ofc/js/swfobject.js')?>"></script> <script type="text/javascript"> swfobject.embedSWF("<?php echo fileurl('/lib/js/ofc/open-flash-chart.swf');?>", "summary_chart", "<?php echo $chart_width;?>", "<?php echo $chart_height;?>", "9.0.0", "expressInstall.swf", {"data-file":"<?php echo actionurl('/finances/viewmonthchart?'.$_SERVER['QUERY_STRING']); ?>"}); </script> <?php /* End added in 2.0 */ ?> </div> i have tried multiple times to alter al width lines(mainly line 27) but nothing works i don't have anny flash chart in there or i am looking in the wrong tpl regards Quote Link to comment Share on other sites More sharing options...
tutmeister Posted July 26, 2012 Report Share Posted July 26, 2012 Topic says solved, but just so others might see the solution. In the template above, you've got the width hardcoded into the HTML code for the table like so: <table width="500px" align="center" class="balancesheet" cellpadding="0" cellspacing="0"> If you change 500 to whatever you need, that'll change the table width. The code for the flash chart is at the bottom in the javascript: <script type="text/javascript"> swfobject.embedSWF("<?php echo fileurl('/lib/js/ofc/open-flash-chart.swf');?>", "summary_chart", "<?php echo $chart_width;?>", "<?php echo $chart_height;?>", "9.0.0", "expressInstall.swf", {"data-file":"<?php echo actionurl('/finances/viewmonthchart?'.$_SERVER['QUERY_STRING']); ?>"}); </script> It's calling two PHP variables, which are assigned just a few lines above: $chart_width = '500'; $chart_height = '500'; So just change those numbers to the width and height you want your flash chart to be. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.