Author Topic: Pie chart Backwards  (Read 479 times)

0 Members and 1 Guest are viewing this topic.

Offline cospringswx

  • Forecaster
  • *****
  • Posts: 4136
    • Colorado Springs Weather
Pie chart Backwards
« on: May 25, 2015, 09:03:36 PM »
My pie chart is backwards. How do I switch this pie around? The code is below. Or if someone has a more updated code post it here.

Thanks,
Ryan


Code: [Select]
<?php
            
//Make piechart
            
$testtime substr($hoursofpossibledaylight,0,2);
            
$testminute substr($hoursofpossibledaylight,3,2);
            
$testminute=$testminute/60;
            
$testresult=$testtime+$testminute;
            
$testljus=round(($testresult/24)*100,1);
            
$testmorker=100-$testljus;
        
?>

            <span class="thisPage" style="position: relative; font-weight:lighter">
          <?php
            $time_arr 
explode(':'$hoursofpossibledaylight2);
            echo (int)
$time_arr[0] . " hrs " . (int)$time_arr[1] . " min";
            echo 
'<br/>of Daylight Today<br/>';
        
?>

            </span>
            <img style="margin-top:4px" src="http://chart.apis.google.com/chart?chs=185x100&amp;chma=0,0,0,0&amp;chd=t:<?php echo $testmorker;?>,<?php echo $testljus;?>&amp;cht=p3&amp;chp=1.6&amp;chf=bg,s,ffffff&amp;chco=ffd700,000000" alt="graph"/>
            <br />
            <span style="position:relative; float:left; margin-top:-60px; margin-left:34px; font-weight:lighter; color:#000000">        <!-- was -5 -->
                <?php echo $testmorker "%"?>
            </span>
            <span style=" position:relative; float:right; margin-top:-47px; margin-right:40px; font-weight:lighter; color:#ffffff">      <!-- was 5 -->
                <?php echo $testljus "%"?>
            </span>
            <span class="thisPage" style=" position:relative; font-weight:lighter; top:-8px">
        <?php
            
echo '<br/>Which is <br/>';
            
$time_arr explode(':'$changeinday);
            if (
substr($time_arr[0],0,1) != "-") {         // -0 when getting shorter
                
echo (int)$time_arr[1] . " min Longer";
            } else {
                echo (int)
$time_arr[1] . " min Shorter";
            }
            echo (
'<br />Than Yesterday');
        
?>




Ryan 

Colorado Springs, CO
www.cospringsweather.com
Davis Vantage Vue
Weather Display Software
Amcrest HD IP Camera

Offline cospringswx

  • Forecaster
  • *****
  • Posts: 4136
    • Colorado Springs Weather
Re: Pie chart Backwards
« Reply #1 on: May 25, 2015, 10:29:45 PM »
I fixed it. I switched the testmorker and testljus around.




Ryan 

Colorado Springs, CO
www.cospringsweather.com
Davis Vantage Vue
Weather Display Software
Amcrest HD IP Camera

 

anything