Skip to content

Commit

Permalink
Merge pull request #889 from tlnagy/fix-minmax-overwrite
Browse files Browse the repository at this point in the history
check if min and max values are set before overwriting
  • Loading branch information
tlnagy authored Sep 1, 2016
2 parents 80ac5eb + 80d8fd7 commit 24edf01
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/statistics.jl
Original file line number Diff line number Diff line change
Expand Up @@ -205,10 +205,13 @@ function apply_statistic(stat::BarStatistic,
end

iscontinuous = haskey(scales, var) && isa(scales[var], Scale.ContinuousScale)
minvals, maxvals = barminmax(values, iscontinuous)

setfield!(aes, minvar, minvals)
setfield!(aes, maxvar, maxvals)
if getfield(aes, minvar) == nothing || getfield(aes, maxvar) == nothing
minvals, maxvals = barminmax(values, iscontinuous)

setfield!(aes, minvar, minvals)
setfield!(aes, maxvar, maxvals)
end

z = zero(eltype(getfield(aes, othervar)))
if getfield(aes, viewminvar) == nothing && z < minimum(getfield(aes, othervar))
Expand Down

0 comments on commit 24edf01

Please sign in to comment.