Bounding the xLabelAngle option.

This commit is contained in:
Olly Smith 2013-05-09 22:20:48 +01:00
parent 05cdc7f3e4
commit 95667e2240
3 changed files with 5 additions and 1 deletions

View File

@ -21,6 +21,9 @@ class Morris.Grid extends Morris.EventEmitter
if typeof @options.units is 'string'
@options.postUnits = options.units
# bound xLabelAngle to 0..90
@options.xLabelAngle = Math.max(0, Math.min(90, @options.xLabelAngle))
# the raphael drawing instance
@raphael = new Raphael(@el[0])

View File

@ -84,6 +84,7 @@
if (typeof this.options.units === 'string') {
this.options.postUnits = options.units;
}
this.options.xLabelAngle = Math.max(0, Math.min(90, this.options.xLabelAngle));
this.raphael = new Raphael(this.el[0]);
this.elementWidth = null;
this.elementHeight = null;

2
morris.min.js vendored

File diff suppressed because one or more lines are too long