Plugin Directory

Changeset 217580


Ignore:
Timestamp:
03/14/2010 08:08:58 PM (16 years ago)
Author:
anukit
Message:

trying to avoid too much space at the bottom of the graph

File:
1 edited

Legend:

Unmodified
Added
Removed
  • cyclopress/branches/cp2/classes/cy_google_charts.php

    r217576 r217580  
    153153       
    154154        // get nice tick ranges for the data
     155        $range = $max - $min;
     156        $smart_min = ($min > $range) ? floor($min - ($range*0.1)) : 0; // avoid too much space at the bottom of the chart
    155157        list($x_tick_range, $x_lower_bound, $x_upper_bound) = $this->get_chart_step_size(7, (count($x_data)-1), 1);
    156         list($y_tick_range, $y_lower_bound, $y_upper_bound) = $this->get_chart_step_size(8, $max, 0);
     158        list($y_tick_range, $y_lower_bound, $y_upper_bound) = $this->get_chart_step_size(8, $max, $smart_min);
    157159
    158160        // get labels and nicely-spaced label positions
     
    224226           
    225227            // grid lines: <x_axis_step_size>,<y_axis_step_size>,<dash_length>,<space_length>
    226             $q[] = 'chg='.(100 / (count($x_labels) - 1)).','.(100 / (count($y_labels) - 1)).',1,5';
     228            $q[] = 'chg='.(100 / (count($x_labels) - 1)).','.(100 / (count($y_labels) - 1)).',1,1';
    227229           
    228230        }
Note: See TracChangeset for help on using the changeset viewer.