From 0f367b91a2d0a30256a7957daacf3a79486d3781 Mon Sep 17 00:00:00 2001 From: Richard Wall Date: Tue, 13 Jul 2010 21:02:03 +0100 Subject: Allow overriding of yaxis tickDecimals --- jarmon.js | 39 +++++++++++++++++++++++++++------------ 1 file changed, 27 insertions(+), 12 deletions(-) diff --git a/jarmon.js b/jarmon.js index c6da509..6b29692 100644 --- a/jarmon.js +++ b/jarmon.js @@ -362,12 +362,19 @@ jarmon.Chart = function(template, options) { } } + if(self.options.yaxis.tickDecimals != null) { + decimalPlaces = self.options.yaxis.tickDecimals; + } + var tickMin = minVal - minVal % stepSize; var tickMax = maxVal - maxVal % stepSize + stepSize var ticks = []; for(var j=tickMin; j<=tickMax; j+=stepSize) { - ticks.push([j*Math.pow(1000, si), j.toFixed(decimalPlaces)]); + ticks.push([ + j*Math.pow(1000, si), + j.toFixed(decimalPlaces) + ]); } self.siPrefix = siPrefixes[si]; @@ -652,6 +659,11 @@ jarmon.ChartCoordinator = function(ui) { options.append($('