Skip to content

Commit

Permalink
Fix stacked=false in bar chart (fixes #275).
Browse files Browse the repository at this point in the history
  • Loading branch information
oesmith committed Jun 14, 2014
1 parent 4346d98 commit 587ecaa
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lib/morris.bar.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion morris.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
Loading

0 comments on commit 587ecaa

Please sign in to comment.