|
@ -40,8 +40,6 @@ function TimeAxis (body, options) { |
|
|
// TODO: implement timeaxis orientations 'left' and 'right'
|
|
|
// TODO: implement timeaxis orientations 'left' and 'right'
|
|
|
showMinorLabels: true, |
|
|
showMinorLabels: true, |
|
|
showMajorLabels: true, |
|
|
showMajorLabels: true, |
|
|
showMajorLines: true, |
|
|
|
|
|
showMinorLines: true, |
|
|
|
|
|
format: null |
|
|
format: null |
|
|
}; |
|
|
}; |
|
|
this.options = util.extend({}, this.defaultOptions); |
|
|
this.options = util.extend({}, this.defaultOptions); |
|
@ -67,7 +65,13 @@ TimeAxis.prototype = new Component(); |
|
|
TimeAxis.prototype.setOptions = function(options) { |
|
|
TimeAxis.prototype.setOptions = function(options) { |
|
|
if (options) { |
|
|
if (options) { |
|
|
// copy all options that we know
|
|
|
// copy all options that we know
|
|
|
util.selectiveExtend(['orientation', 'showMinorLabels', 'showMajorLabels', 'showMinorLines', 'showMajorLines','hiddenDates', 'format'], this.options, options); |
|
|
|
|
|
|
|
|
util.selectiveExtend([ |
|
|
|
|
|
'orientation', |
|
|
|
|
|
'showMinorLabels', |
|
|
|
|
|
'showMajorLabels', |
|
|
|
|
|
'hiddenDates', |
|
|
|
|
|
'format' |
|
|
|
|
|
], this.options, options); |
|
|
|
|
|
|
|
|
// apply locale to moment.js
|
|
|
// apply locale to moment.js
|
|
|
// TODO: not so nice, this is applied globally to moment.js
|
|
|
// TODO: not so nice, this is applied globally to moment.js
|
|
@ -226,11 +230,9 @@ TimeAxis.prototype._repaintLabels = function () { |
|
|
} |
|
|
} |
|
|
this._repaintMajorText(x, step.getLabelMajor(), orientation); |
|
|
this._repaintMajorText(x, step.getLabelMajor(), orientation); |
|
|
} |
|
|
} |
|
|
if (this.options.showMajorLines == true) { |
|
|
|
|
|
this._repaintMajorLine(x, orientation); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
this._repaintMajorLine(x, orientation); |
|
|
} |
|
|
} |
|
|
else if (this.options.showMinorLines == true) { |
|
|
|
|
|
|
|
|
else { |
|
|
this._repaintMinorLine(x, orientation); |
|
|
this._repaintMinorLine(x, orientation); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|