Skip to content

Commit

Permalink
Morris.Donut#select(idx) for selecting donut segments (ref #79).
Browse files Browse the repository at this point in the history
  • Loading branch information
oesmith committed Sep 26, 2012
1 parent 9bb7230 commit 43019ee
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 7 deletions.
7 changes: 4 additions & 3 deletions lib/morris.donut.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -85,13 +85,14 @@ class Morris.Donut
idx = 0
for d in @data
if d.value == max_value
@select @segments[idx]
@select idx
break
idx += 1

# @private
select: (segment) =>
# Select the segment at the given index.
select: (idx) =>
s.deselect() for s in @segments
segment = @segments[idx]
segment.select()
@setLabels segment.data.label, @options.formatter(segment.data.value)

Expand Down
7 changes: 4 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 43019ee

Please sign in to comment.