mirror of
https://github.com/morrisjs/morris.js.git
synced 2024-11-10 21:36:34 +01:00
Fix stacked=false in bar chart (fixes #275).
This commit is contained in:
parent
4346d98fdd
commit
587ecaa784
@ -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)
|
||||
|
@ -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
2
morris.min.js
vendored
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue
Block a user