Author: croberts
Date: 2011-11-03 15:07:34 +0000 (Thu, 03 Nov 2011)
New Revision: 5109
Modified:
branches/noflash/cumin/resources/app.js
Log:
Attempt to make y-axis values smarter for large values (> 10M)
Modified: branches/noflash/cumin/resources/app.js
===================================================================
--- branches/noflash/cumin/resources/app.js 2011-11-03 14:27:12 UTC (rev 5108)
+++ branches/noflash/cumin/resources/app.js 2011-11-03 15:07:34 UTC (rev 5109)
@@ -551,7 +551,8 @@
y2axis: {
autoscale: true,
min:0,
- tickOptions:{formatString:'%.0f'},
+ tickOptions:{formatString:'%.0f',
+ formatter: y_axis_Formatter,},
numberTicks:4,
},
xaxis: {
@@ -622,6 +623,25 @@
}
}
+y_axis_Formatter = function (format, val) {
+ tickval = "";
+ if (typeof val == 'number') {
+ if (!format) {
+ format = $j.jqplot.config.defaultTickFormatString;
+ }
+ if (val > 10000000) {
+ val = val / 1000000
+ format = "%.2fM";
+ }
+
+ tickval = $j.jqplot.sprintf(format, val);
+ }
+ else {
+ return String(val);
+ }
+ return tickval;
+}
+
updatePieChart = function (piediv, vals, colors) {
var data = vals;
Show replies by date