Fix stacked=false in bar chart (fixes #275).

This commit is contained in:
Olly Smith 2014-06-14 09:58:16 +01:00
parent 4346d98fdd
commit 587ecaa784
3 changed files with 3 additions and 3 deletions

View File

@ -90,7 +90,7 @@ class Morris.Bar extends Morris.Grid
# @private
drawSeries: ->
groupWidth = @width / @options.data.length
numBars = if @options.stacked? then 1 else @options.ykeys.length
numBars = if @options.stacked then 1 else @options.ykeys.length
barWidth = (groupWidth * @options.barSizeRatio - @options.barGap * (numBars - 1)) / numBars
barWidth = Math.min(barWidth, @options.barSize) if @options.barSize
spaceLeft = groupWidth - barWidth * numBars - @options.barGap * (numBars - 1)

View File

@ -1486,7 +1486,7 @@ Licensed under the BSD-2-Clause License.
Bar.prototype.drawSeries = function() {
var barWidth, bottom, groupWidth, idx, lastTop, left, leftPadding, numBars, row, sidx, size, spaceLeft, top, ypos, zeroPos;
groupWidth = this.width / this.options.data.length;
numBars = this.options.stacked != null ? 1 : this.options.ykeys.length;
numBars = this.options.stacked ? 1 : this.options.ykeys.length;
barWidth = (groupWidth * this.options.barSizeRatio - this.options.barGap * (numBars - 1)) / numBars;
if (this.options.barSize) {
barWidth = Math.min(barWidth, this.options.barSize);

2
morris.min.js vendored

File diff suppressed because one or more lines are too long