Skip to content

Commit

Permalink
option hoverReversed
Browse files Browse the repository at this point in the history
  • Loading branch information
Pierre Clavequin committed Feb 15, 2018
1 parent 9e71044 commit 1065085
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 8 deletions.
6 changes: 3 additions & 3 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ module.exports = function (grunt) {
'build/morris.coffee': {
options: {
banner: "### @license\n"+
"<%= pkg.name %> v<%= pkg.version %>\n"+
"<%= pkg.name %> v<%= pkg.version %> \n"+
"https://pierresh.github.io/morris.js/\n"+
"Copyright <%= (new Date()).getFullYear() %> <%= pkg.author.name %> All rights reserved.\n" +
"Licensed under the <%= pkg.license %> License.\n" +
"###\n",
"Licensed under the <%= pkg.license %> License. ###\n",
},
src: [
'lib/morris.coffee',
Expand Down
5 changes: 3 additions & 2 deletions lib/morris.line.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ class Morris.Line extends Morris.Grid
pointFillColors: []
pointSuperimposed: true
hoverOrdered: false
hoverReversed: false
smooth: true
lineType: {}
shown: true
Expand Down Expand Up @@ -129,7 +130,7 @@ class Morris.Line extends Morris.Grid
content = ""

order = []
if @options.hoverOrdered is true || @options.hoverOrdered == 'reverse'
if @options.hoverOrdered is true
for yy, jj in row.y
max = null
max_pos = -1
Expand All @@ -143,7 +144,7 @@ class Morris.Line extends Morris.Grid
for yy, jj in row.y by -1
order.push(jj)

if @options.hoverOrdered == 'reverse' then order = order.reverse()
if @options.hoverReversed is true then order = order.reverse()

for j in order by -1
if @options.labels[j] is false
Expand Down
5 changes: 3 additions & 2 deletions morris.js
Original file line number Diff line number Diff line change
Expand Up @@ -1155,6 +1155,7 @@ Licensed under the BSD-2-Clause License.
pointFillColors: [],
pointSuperimposed: true,
hoverOrdered: false,
hoverReversed: false,
smooth: true,
lineType: {},
shown: true,
Expand Down Expand Up @@ -1307,7 +1308,7 @@ Licensed under the BSD-2-Clause License.
row = this.data[index];
content = "";
order = [];
if (this.options.hoverOrdered === true || this.options.hoverOrdered === 'reverse') {
if (this.options.hoverOrdered === true) {
_ref = row.y;
for (jj = _i = 0, _len = _ref.length; _i < _len; jj = ++_i) {
yy = _ref[jj];
Expand All @@ -1332,7 +1333,7 @@ Licensed under the BSD-2-Clause License.
order.push(jj);
}
}
if (this.options.hoverOrdered === 'reverse') {
if (this.options.hoverReversed === true) {
order = order.reverse();
}
for (_l = order.length - 1; _l >= 0; _l += -1) {
Expand Down
2 changes: 1 addition & 1 deletion morris.min.js

Large diffs are not rendered by default.

0 comments on commit 1065085

Please sign in to comment.