Skip to content

Commit

Permalink
Don't sort data when parseTime is false. Fixes #83.
Browse files Browse the repository at this point in the history
  • Loading branch information
oesmith committed Oct 3, 2012
1 parent 2903d08 commit 7775332
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 5 deletions.
6 changes: 5 additions & 1 deletion lib/morris.line.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,11 @@ class Morris.Line
setData: (data, redraw = true) ->
# shallow copy & sort data
@options.data = data.slice(0)
@options.data.sort (a, b) => (a[@options.xkey] < b[@options.xkey]) - (b[@options.xkey] < a[@options.xkey])
if @options.parseTime
@options.data.sort (a, b) =>
(a[@options.xkey] < b[@options.xkey]) - (b[@options.xkey] < a[@options.xkey])
else
@options.data.reverse()
# extract labels
@columnLabels = $.map @options.data, (d) => d[@options.xkey]

Expand Down
10 changes: 7 additions & 3 deletions morris.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 7775332

Please sign in to comment.