mirror of
https://github.com/morrisjs/morris.js.git
synced 2024-11-11 05:46:37 +01:00
Merge pull request #457 from JelteF/horizontal-bar-fixes
Horizontal bar: Fix stacked and vertical grid
This commit is contained in:
commit
089109093f
@ -152,17 +152,22 @@ class Morris.Bar extends Morris.Grid
|
|||||||
size = bottom - top
|
size = bottom - top
|
||||||
|
|
||||||
if @options.verticalGridCondition and @options.verticalGridCondition(row.x)
|
if @options.verticalGridCondition and @options.verticalGridCondition(row.x)
|
||||||
@drawBar(@left + idx * groupWidth, @top, groupWidth, Math.abs(@top - @bottom), @options.verticalGridColor, @options.verticalGridOpacity, @options.barRadius)
|
if not @options.horizontal
|
||||||
|
@drawBar(@xStart + idx * groupWidth, @yEnd, groupWidth, @ySize, @options.verticalGridColor, @options.verticalGridOpacity, @options.barRadius)
|
||||||
|
else
|
||||||
|
@drawBar(@yStart, @xStart + idx * groupWidth, @ySize, groupWidth, @options.verticalGridColor, @options.verticalGridOpacity, @options.barRadius)
|
||||||
|
|
||||||
|
|
||||||
top -= lastTop if @options.stacked
|
top -= lastTop if @options.stacked
|
||||||
if not @options.horizontal
|
if not @options.horizontal
|
||||||
@drawBar(left, top, barWidth, size, @colorFor(row, sidx, 'bar'),
|
@drawBar(left, top, barWidth, size, @colorFor(row, sidx, 'bar'),
|
||||||
@options.barOpacity, @options.barRadius)
|
@options.barOpacity, @options.barRadius)
|
||||||
|
lastTop += size
|
||||||
else
|
else
|
||||||
@drawBar(top, left, size, barWidth, @colorFor(row, sidx, 'bar'),
|
@drawBar(top, left, size, barWidth, @colorFor(row, sidx, 'bar'),
|
||||||
@options.barOpacity, @options.barRadius)
|
@options.barOpacity, @options.barRadius)
|
||||||
|
lastTop -= size
|
||||||
|
|
||||||
lastTop += size
|
|
||||||
|
|
||||||
else
|
else
|
||||||
null
|
null
|
||||||
|
Loading…
Reference in New Issue
Block a user