projects
/
dygraphs.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Change x-axis pixel spacing default to 70.
[dygraphs.git]
/
dygraph.js
diff --git
a/dygraph.js
b/dygraph.js
index
348ef6c
..
43768a9
100644
(file)
--- a/
dygraph.js
+++ b/
dygraph.js
@@
-226,12
+226,12
@@
Dygraph.dateAxisLabelFormatter = function(date, granularity, opts) {
if (granularity >= Dygraph.DECADAL) {
return '' + year;
} else if (granularity >= Dygraph.MONTHLY) {
if (granularity >= Dygraph.DECADAL) {
return '' + year;
} else if (granularity >= Dygraph.MONTHLY) {
- return Dygraph.SHORT_MONTH_NAMES_[month] + '
' + year;
+ return Dygraph.SHORT_MONTH_NAMES_[month] + '
 
' + year;
} else {
var frac = hours * 3600 + mins * 60 + secs + 1e-3 * millis;
if (frac === 0 || granularity >= Dygraph.DAILY) {
} else {
var frac = hours * 3600 + mins * 60 + secs + 1e-3 * millis;
if (frac === 0 || granularity >= Dygraph.DAILY) {
- // e.g. '21Jan' (%d%b)
- return Dygraph.zeropad(day) + Dygraph.SHORT_MONTH_NAMES_[month];
+ // e.g. '21
Jan' (%d%b)
+ return Dygraph.zeropad(day) +
' ' +
Dygraph.SHORT_MONTH_NAMES_[month];
} else {
return Dygraph.hmsString_(hours, mins, secs);
}
} else {
return Dygraph.hmsString_(hours, mins, secs);
}
@@
-290,8
+290,6
@@
Dygraph.DEFAULT_ATTRS = {
axisTickSize: 3,
axisLabelFontSize: 14,
axisTickSize: 3,
axisLabelFontSize: 14,
- xAxisLabelWidth: 50,
- yAxisLabelWidth: 50,
rightGap: 5,
showRoller: false,
rightGap: 5,
showRoller: false,
@@
-360,7
+358,8
@@
Dygraph.DEFAULT_ATTRS = {
// per-axis options
axes: {
x: {
// per-axis options
axes: {
x: {
- pixelsPerLabel: 60,
+ pixelsPerLabel: 70,
+ axisLabelWidth: 60,
axisLabelFormatter: Dygraph.dateAxisLabelFormatter,
valueFormatter: Dygraph.dateValueFormatter,
drawGrid: true,
axisLabelFormatter: Dygraph.dateAxisLabelFormatter,
valueFormatter: Dygraph.dateValueFormatter,
drawGrid: true,
@@
-369,6
+368,7
@@
Dygraph.DEFAULT_ATTRS = {
ticker: null // will be set in dygraph-tickers.js
},
y: {
ticker: null // will be set in dygraph-tickers.js
},
y: {
+ axisLabelWidth: 50,
pixelsPerLabel: 30,
valueFormatter: Dygraph.numberValueFormatter,
axisLabelFormatter: Dygraph.numberAxisLabelFormatter,
pixelsPerLabel: 30,
valueFormatter: Dygraph.numberValueFormatter,
axisLabelFormatter: Dygraph.numberAxisLabelFormatter,
@@
-378,10
+378,11
@@
Dygraph.DEFAULT_ATTRS = {
ticker: null // will be set in dygraph-tickers.js
},
y2: {
ticker: null // will be set in dygraph-tickers.js
},
y2: {
+ axisLabelWidth: 50,
pixelsPerLabel: 30,
valueFormatter: Dygraph.numberValueFormatter,
axisLabelFormatter: Dygraph.numberAxisLabelFormatter,
pixelsPerLabel: 30,
valueFormatter: Dygraph.numberValueFormatter,
axisLabelFormatter: Dygraph.numberAxisLabelFormatter,
- drawAxis:
false,
+ drawAxis:
true, // only applies when there are two axes of data.
drawGrid: false,
independentTicks: false,
ticker: null // will be set in dygraph-tickers.js
drawGrid: false,
independentTicks: false,
ticker: null // will be set in dygraph-tickers.js
@@
-2317,7
+2318,7
@@
Dygraph.prototype.addXTicks_ = function() {
var xTicks = xAxisOptionsView('ticker')(
range[0],
range[1],
var xTicks = xAxisOptionsView('ticker')(
range[0],
range[1],
- this.
width_
, // TODO(danvk): should be area.width
+ this.
plotter_.area.w
, // TODO(danvk): should be area.width
xAxisOptionsView,
this);
// var msg = 'ticker(' + range[0] + ', ' + range[1] + ', ' + this.width_ + ', ' + this.attr_('pixelsPerXLabel') + ') -> ' + JSON.stringify(xTicks);
xAxisOptionsView,
this);
// var msg = 'ticker(' + range[0] + ', ' + range[1] + ', ' + this.width_ + ', ' + this.attr_('pixelsPerXLabel') + ') -> ' + JSON.stringify(xTicks);
@@
-2971,7
+2972,7
@@
Dygraph.prototype.computeYAxisRanges_ = function(extremes) {
var ticker = opts('ticker');
axis.ticks = ticker(axis.computedValueRange[0],
axis.computedValueRange[1],
var ticker = opts('ticker');
axis.ticks = ticker(axis.computedValueRange[0],
axis.computedValueRange[1],
- this.
height_, // TODO(danvk): should be area.height
+ this.
plotter_.area.h,
opts,
this);
// Define the first independent axis as primary axis.
opts,
this);
// Define the first independent axis as primary axis.
@@
-3002,7
+3003,7
@@
Dygraph.prototype.computeYAxisRanges_ = function(extremes) {
axis.ticks = ticker(axis.computedValueRange[0],
axis.computedValueRange[1],
axis.ticks = ticker(axis.computedValueRange[0],
axis.computedValueRange[1],
- this.
height_, // TODO(danvk): should be area.height
+ this.
plotter_.area.h,
opts,
this,
tick_values);
opts,
this,
tick_values);
@@
-3587,6
+3588,8
@@
Dygraph.mapLegacyOptions_ = function(attrs) {
map('drawXAxis', 'x', 'drawAxis');
map('drawYGrid', 'y', 'drawGrid');
map('drawYAxis', 'y', 'drawAxis');
map('drawXAxis', 'x', 'drawAxis');
map('drawYGrid', 'y', 'drawGrid');
map('drawYAxis', 'y', 'drawAxis');
+ map('xAxisLabelWidth', 'x', 'axisLabelWidth');
+ map('yAxisLabelWidth', 'y', 'axisLabelWidth');
return my_attrs;
};
return my_attrs;
};