Skip to content

Commit

Permalink
Merge pull request #314 from abrinkman/master
Browse files Browse the repository at this point in the history
Adds the ability to mark events on a non-time-based line and area charts.
  • Loading branch information
oesmith committed Nov 9, 2013
2 parents a738317 + b162e18 commit 3cba9e5
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 14 deletions.
7 changes: 5 additions & 2 deletions lib/morris.grid.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -186,8 +186,11 @@ class Morris.Grid extends Morris.EventEmitter
@xmax = @data[@data.length - 1].x

@events = []
if @options.parseTime and @options.events.length > 0
@events = (Morris.parseDate(e) for e in @options.events)
if @options.events.length > 0
if @options.parseTime
@events = (Morris.parseDate(e) for e in @options.events)
else
@events = @options.events
@xmax = Math.max(@xmax, Math.max.apply(null, @events))
@xmin = Math.min(@xmin, Math.min.apply(null, @events))

Expand Down
26 changes: 15 additions & 11 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 3cba9e5

Please sign in to comment.