function flotStyle::axis_range in Flot 6
Same name and namespace in other branches
- 7 flot.module \flotStyle::axis_range()
File
- ./
flot.module, line 168
Class
- flotStyle
- Style class for the flot API.
Code
function axis_range($axis = 'yaxis', $range = array(), $granularity = 0) {
if (count($range)) {
$this->{$axis} = new StdClass();
$this->{$axis}->min = min($range);
$this->{$axis}->max = max($range);
if (is_numeric($granularity) && $granularity != 0) {
$tickSize = ($this->{$axis}->max - $this->{$axis}->min) / $granularity;
$this->{$axis}->tickSize = floor($tickSize);
}
}
}