range_calc (SVG::Graph::Graph)

    # File temp/Graph/Graph.rb, line 149
          def range_calc(value, range)
            value = range
            division = 0
            max = 0
            count = 0

            if value == 0
              division = 0.2
              max = 1
              return [max, division, 1]
            end

            if value < 1
              while value < 1
                value *= 10
                count += 1
              end
              division = 1
              count.downto(0) { division /= 10 }
              max = (range.to_f / division).ceil * division
            else
              while value > 10
                value /= 10
                count += 1
              end
              division = 1
              count.downto(0) { division *= 10 }
              max = (range.to_f / division).ceil * division
            end

            if (max / division) <= 2
              division /= 5
              max = (range.to_f / division).ceil * division
            elsif (max / division) <= 5
              division /= 2
              max = (range.to_f / division).ceil * division
            end

            if division >= 1
              count = 0
            else
              count = division.to_s.length - 2
            end

            return [max, division, count]
          end