Skip to content

Commit

Permalink
fix bug in goals chart where the sum of all bars could be larger than…
Browse files Browse the repository at this point in the history
… the expected y-axis window, making the drag handles invisible
  • Loading branch information
jcarver989 committed Feb 8, 2017
1 parent 5946694 commit 9e14233
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
8 changes: 4 additions & 4 deletions dist/suave-charts.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion src/coffeescript/goals_chart.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,9 @@ class GoalsChart extends AbstractChart
tooltipLabels = if data.tooltipLabels? then data.tooltipLabels else ("" for x in data.labels)
data.bars.forEach((v, i) -> barData.push({ value: v, label: data.labels[i], tooltipLabel: tooltipLabels[i] }))

@y.domain(data.domain)
[min, expectedMax] = data.domain
max = Math.max(startingTotal, expectedMax)
@y.domain([min, max])
@x.domain(barData.map((d) -> d.label))

@options.margin.left = @calc.calcLeftMargin(@yAxis, @options.margin.left)
Expand Down

0 comments on commit 9e14233

Please sign in to comment.