|
@ -30,6 +30,10 @@ function DataAxis (body, options, svg, linegraphOptions) { |
|
|
customRange: { |
|
|
customRange: { |
|
|
left: {min:undefined, max:undefined}, |
|
|
left: {min:undefined, max:undefined}, |
|
|
right: {min:undefined, max:undefined} |
|
|
right: {min:undefined, max:undefined} |
|
|
|
|
|
}, |
|
|
|
|
|
format: { |
|
|
|
|
|
left: {decimals: undefined}, |
|
|
|
|
|
right: {decimals: undefined} |
|
|
} |
|
|
} |
|
|
}; |
|
|
}; |
|
|
|
|
|
|
|
@ -108,7 +112,8 @@ DataAxis.prototype.setOptions = function (options) { |
|
|
'iconWidth', |
|
|
'iconWidth', |
|
|
'width', |
|
|
'width', |
|
|
'visible', |
|
|
'visible', |
|
|
'customRange' |
|
|
|
|
|
|
|
|
'customRange', |
|
|
|
|
|
'format' |
|
|
]; |
|
|
]; |
|
|
util.selectiveExtend(fields, this.options, options); |
|
|
util.selectiveExtend(fields, this.options, options); |
|
|
|
|
|
|
|
@ -326,6 +331,12 @@ DataAxis.prototype._redrawLabels = function () { |
|
|
// do not draw the first label
|
|
|
// do not draw the first label
|
|
|
var max = 1; |
|
|
var max = 1; |
|
|
|
|
|
|
|
|
|
|
|
// Get the number of decimal places
|
|
|
|
|
|
var decimals; |
|
|
|
|
|
if(this.options.format[orientation] !== undefined) { |
|
|
|
|
|
decimals = this.options.format[orientation].decimals; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
this.maxLabelSize = 0; |
|
|
this.maxLabelSize = 0; |
|
|
var y = 0; |
|
|
var y = 0; |
|
|
while (max < Math.round(amountOfSteps)) { |
|
|
while (max < Math.round(amountOfSteps)) { |
|
@ -335,13 +346,13 @@ DataAxis.prototype._redrawLabels = function () { |
|
|
var isMajor = step.isMajor(); |
|
|
var isMajor = step.isMajor(); |
|
|
|
|
|
|
|
|
if (this.options['showMinorLabels'] && isMajor == false || this.master == false && this.options['showMinorLabels'] == true) { |
|
|
if (this.options['showMinorLabels'] && isMajor == false || this.master == false && this.options['showMinorLabels'] == true) { |
|
|
this._redrawLabel(y - 2, step.getCurrent(), orientation, 'yAxis minor', this.props.minorCharHeight); |
|
|
|
|
|
|
|
|
this._redrawLabel(y - 2, step.getCurrent(decimals), orientation, 'yAxis minor', this.props.minorCharHeight); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
if (isMajor && this.options['showMajorLabels'] && this.master == true || |
|
|
if (isMajor && this.options['showMajorLabels'] && this.master == true || |
|
|
this.options['showMinorLabels'] == false && this.master == false && isMajor == true) { |
|
|
this.options['showMinorLabels'] == false && this.master == false && isMajor == true) { |
|
|
if (y >= 0) { |
|
|
if (y >= 0) { |
|
|
this._redrawLabel(y - 2, step.getCurrent(), orientation, 'yAxis major', this.props.majorCharHeight); |
|
|
|
|
|
|
|
|
this._redrawLabel(y - 2, step.getCurrent(decimals), orientation, 'yAxis major', this.props.majorCharHeight); |
|
|
} |
|
|
} |
|
|
this._redrawLine(y, orientation, 'grid horizontal major', this.options.majorLinesOffset, this.props.majorLineWidth); |
|
|
this._redrawLine(y, orientation, 'grid horizontal major', this.options.majorLinesOffset, this.props.majorLineWidth); |
|
|
} |
|
|
} |
|
|