The axis values are calculated automatically at the minValue, maxValue, and 
1/4 increments of the axis between them (ex: 0, 25, 50, 75, 100).  I wrote a 
function that calculates the maxValue based on a given largest value in the 
series, minimum axis value, and whether the scale is linear or logarithmic

/*  this function finds the smallest integer value >= val that gives integer 
values for the 
 *  25%, 50%, and 75% axis increments, given a minimum value of min
 *  parameters:
 *      val = the value to start at
 *      min = the minimum axis value
 *      log = boolean, true if the axis has a logarithmic scale
 *  returns the max axis value
 */
function findMaxAxisValue(val, min, log) {
    var max = Math.ceil(val);
    if (log) {
        while(Math.pow(max, 0.25) !== parseInt(Math.pow(max, 0.25))) {
            max++;
        }
    }
    else {
        while ((max - min)/4 !== parseInt((max - min)/4)) {
            max++;
        }
    }
    return max;
}

-- 
You received this message because you are subscribed to the Google Groups 
"Google Visualization API" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/google-visualization-api/-/3FJ31dMaIkcJ.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-visualization-api?hl=en.

Reply via email to