Skip to content

Commit

Permalink
Display color in hover in order for horizontal bar
Browse files Browse the repository at this point in the history
  • Loading branch information
Pierre Clavequin committed Dec 29, 2017
1 parent 1f388f3 commit 38527d4
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
5 changes: 4 additions & 1 deletion lib/morris.bar.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,10 @@ class Morris.Bar extends Morris.Grid
content = $("<div class='morris-hover-row-label'>").text(row.label)
content = content.prop('outerHTML')
for y, jj in row.y
j = row.y.length - 1 - jj
if @options.horizontal
j = jj
else
j = row.y.length - 1 - jj
if @options.labels[j] is false
continue

Expand Down
6 changes: 5 additions & 1 deletion morris.js
Original file line number Diff line number Diff line change
Expand Up @@ -2004,7 +2004,11 @@ Licensed under the BSD-2-Clause License.
_ref = row.y;
for (jj = _i = 0, _len = _ref.length; _i < _len; jj = ++_i) {
y = _ref[jj];
j = row.y.length - 1 - jj;
if (this.options.horizontal) {
j = jj;
} else {
j = row.y.length - 1 - jj;
}
if (this.options.labels[j] === false) {
continue;
}
Expand Down
Loading

0 comments on commit 38527d4

Please sign in to comment.