Skip to content

Commit

Permalink
Fix area chart fill colors for very light lines (fixes #190).
Browse files Browse the repository at this point in the history
  • Loading branch information
oesmith committed May 10, 2013
1 parent b722937 commit e5c856f
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/morris.area.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ class Morris.Area extends Morris.Line
areaOptions = $.extend {}, areaDefaults, options

@cumulative = not areaOptions.behaveLikeLine

if areaOptions.fillOpacity is 'auto'
areaOptions.fillOpacity = if areaOptions.behaveLikeLine then .8 else 1

Expand Down Expand Up @@ -40,7 +40,7 @@ class Morris.Area extends Morris.Line
range = [0..@options.ykeys.length-1]
else
range = [@options.ykeys.length-1..0]

for i in range
@_drawFillFor i
@_drawLineFor i
Expand All @@ -56,8 +56,8 @@ class Morris.Area extends Morris.Line
color = Raphael.rgb2hsl @colorFor(@data[i], i, 'line')
Raphael.hsl(
color.h,
Math.min(255, if @options.behaveLikeLine then color.s * 0.9 else color.s * 0.75),
Math.min(255, if @options.behaveLikeLine then color.l * 1.2 else color.l * 1.25))
if @options.behaveLikeLine then color.s * 0.9 else color.s * 0.75,
Math.min(0.98, if @options.behaveLikeLine then color.l * 1.2 else color.l * 1.25))

drawFilledPath: (path, fill) ->
@raphael.path(path)
Expand Down

0 comments on commit e5c856f

Please sign in to comment.