|
@ -225,7 +225,7 @@ TimeAxis.prototype._repaintLabels = function () { |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
if (this.options.showMinorLabels) { |
|
|
if (this.options.showMinorLabels) { |
|
|
this._repaintMinorText(x, step.getLabelMinor(), orientation); |
|
|
|
|
|
|
|
|
this._repaintMinorText(x, step.getLabelMinor(), orientation, className); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
if (isMajor && this.options.showMajorLabels) { |
|
|
if (isMajor && this.options.showMajorLabels) { |
|
@ -233,7 +233,7 @@ TimeAxis.prototype._repaintLabels = function () { |
|
|
if (xFirstMajorLabel == undefined) { |
|
|
if (xFirstMajorLabel == undefined) { |
|
|
xFirstMajorLabel = x; |
|
|
xFirstMajorLabel = x; |
|
|
} |
|
|
} |
|
|
this._repaintMajorText(x, step.getLabelMajor(), orientation); |
|
|
|
|
|
|
|
|
this._repaintMajorText(x, step.getLabelMajor(), orientation, className); |
|
|
} |
|
|
} |
|
|
if (this.options.showMajorLines == true) { |
|
|
if (this.options.showMajorLines == true) { |
|
|
prevLine = this._repaintMajorLine(x, orientation, className); |
|
|
prevLine = this._repaintMajorLine(x, orientation, className); |
|
@ -253,7 +253,7 @@ TimeAxis.prototype._repaintLabels = function () { |
|
|
widthText = leftText.length * (this.props.majorCharWidth || 10) + 10; // upper bound estimation
|
|
|
widthText = leftText.length * (this.props.majorCharWidth || 10) + 10; // upper bound estimation
|
|
|
|
|
|
|
|
|
if (xFirstMajorLabel == undefined || widthText < xFirstMajorLabel) { |
|
|
if (xFirstMajorLabel == undefined || widthText < xFirstMajorLabel) { |
|
|
this._repaintMajorText(0, leftText, orientation); |
|
|
|
|
|
|
|
|
this._repaintMajorText(0, leftText, orientation, className); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
@ -273,9 +273,10 @@ TimeAxis.prototype._repaintLabels = function () { |
|
|
* @param {Number} x |
|
|
* @param {Number} x |
|
|
* @param {String} text |
|
|
* @param {String} text |
|
|
* @param {String} orientation "top" or "bottom" (default) |
|
|
* @param {String} orientation "top" or "bottom" (default) |
|
|
|
|
|
* @param {String} className |
|
|
* @private |
|
|
* @private |
|
|
*/ |
|
|
*/ |
|
|
TimeAxis.prototype._repaintMinorText = function (x, text, orientation) { |
|
|
|
|
|
|
|
|
TimeAxis.prototype._repaintMinorText = function (x, text, orientation, className) { |
|
|
// reuse redundant label
|
|
|
// reuse redundant label
|
|
|
var label = this.dom.redundant.minorTexts.shift(); |
|
|
var label = this.dom.redundant.minorTexts.shift(); |
|
|
|
|
|
|
|
@ -284,7 +285,6 @@ TimeAxis.prototype._repaintMinorText = function (x, text, orientation) { |
|
|
var content = document.createTextNode(''); |
|
|
var content = document.createTextNode(''); |
|
|
label = document.createElement('div'); |
|
|
label = document.createElement('div'); |
|
|
label.appendChild(content); |
|
|
label.appendChild(content); |
|
|
label.className = 'text minor'; |
|
|
|
|
|
this.dom.foreground.appendChild(label); |
|
|
this.dom.foreground.appendChild(label); |
|
|
} |
|
|
} |
|
|
this.dom.minorTexts.push(label); |
|
|
this.dom.minorTexts.push(label); |
|
@ -293,6 +293,7 @@ TimeAxis.prototype._repaintMinorText = function (x, text, orientation) { |
|
|
|
|
|
|
|
|
label.style.top = (orientation == 'top') ? (this.props.majorLabelHeight + 'px') : '0'; |
|
|
label.style.top = (orientation == 'top') ? (this.props.majorLabelHeight + 'px') : '0'; |
|
|
label.style.left = x + 'px'; |
|
|
label.style.left = x + 'px'; |
|
|
|
|
|
label.className = 'text minor ' + className; |
|
|
//label.title = title; // TODO: this is a heavy operation
|
|
|
//label.title = title; // TODO: this is a heavy operation
|
|
|
}; |
|
|
}; |
|
|
|
|
|
|
|
@ -301,9 +302,10 @@ TimeAxis.prototype._repaintMinorText = function (x, text, orientation) { |
|
|
* @param {Number} x |
|
|
* @param {Number} x |
|
|
* @param {String} text |
|
|
* @param {String} text |
|
|
* @param {String} orientation "top" or "bottom" (default) |
|
|
* @param {String} orientation "top" or "bottom" (default) |
|
|
|
|
|
* @param {String} className |
|
|
* @private |
|
|
* @private |
|
|
*/ |
|
|
*/ |
|
|
TimeAxis.prototype._repaintMajorText = function (x, text, orientation) { |
|
|
|
|
|
|
|
|
TimeAxis.prototype._repaintMajorText = function (x, text, orientation, className) { |
|
|
// reuse redundant label
|
|
|
// reuse redundant label
|
|
|
var label = this.dom.redundant.majorTexts.shift(); |
|
|
var label = this.dom.redundant.majorTexts.shift(); |
|
|
|
|
|
|
|
@ -311,13 +313,13 @@ TimeAxis.prototype._repaintMajorText = function (x, text, orientation) { |
|
|
// create label
|
|
|
// create label
|
|
|
var content = document.createTextNode(text); |
|
|
var content = document.createTextNode(text); |
|
|
label = document.createElement('div'); |
|
|
label = document.createElement('div'); |
|
|
label.className = 'text major'; |
|
|
|
|
|
label.appendChild(content); |
|
|
label.appendChild(content); |
|
|
this.dom.foreground.appendChild(label); |
|
|
this.dom.foreground.appendChild(label); |
|
|
} |
|
|
} |
|
|
this.dom.majorTexts.push(label); |
|
|
this.dom.majorTexts.push(label); |
|
|
|
|
|
|
|
|
label.childNodes[0].nodeValue = text; |
|
|
label.childNodes[0].nodeValue = text; |
|
|
|
|
|
label.className = 'text major ' + className; |
|
|
//label.title = title; // TODO: this is a heavy operation
|
|
|
//label.title = title; // TODO: this is a heavy operation
|
|
|
|
|
|
|
|
|
label.style.top = (orientation == 'top') ? '0' : (this.props.minorLabelHeight + 'px'); |
|
|
label.style.top = (orientation == 'top') ? '0' : (this.props.minorLabelHeight + 'px'); |
|
|