Skip to content

Commit

Permalink
Add ability to customize point fill
Browse files Browse the repository at this point in the history
  • Loading branch information
unimatrixZxero committed Oct 9, 2012
1 parent 05d26c6 commit 528a205
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 8 deletions.
8 changes: 7 additions & 1 deletion lib/morris.line.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,8 @@ class Morris.Line
'#ffffff'
'#ffffff'
]
pointFillColors: [
]
ymax: 'auto'
ymin: 'auto 0'
marginTop: 25
Expand Down Expand Up @@ -313,7 +315,7 @@ class Morris.Line
circle = null
else
circle = @r.circle(c.x, c.y, @options.pointSize)
.attr('fill', @colorForSeries(i))
.attr('fill', @pointFillColorForSeries(i) || @colorForSeries(i))
.attr('stroke-width', @strokeWidthForSeries(i))
.attr('stroke', @strokeForSeries(i))
@seriesPoints[i].push(circle)
Expand Down Expand Up @@ -460,6 +462,10 @@ class Morris.Line
strokeForSeries: (index) ->
@options.pointStrokeColors[index % @options.pointStrokeColors.length]

# @private
pointFillColorForSeries: (index) ->
@options.pointFillColors[index % @options.pointFillColors.length]


# Parse a date into a javascript timestamp
#
Expand Down
11 changes: 7 additions & 4 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 528a205

Please sign in to comment.