Skip to content

Commit

Permalink
startAtBase option added
Browse files Browse the repository at this point in the history
Allows the label to start at the base of the graph.
  • Loading branch information
Forrest Peterson committed Jan 29, 2016
1 parent 9716844 commit 80289c4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/scripts/chartist-plugin-barlabels.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,8 @@

if (options.showZeroLabels || (!options.showZeroLabels && barValue != 0)) {
data.group.elem('text', {
x: data.x2 + options.labelOffset.x,
y: data.y2 + options.labelOffset.y,
x: ((options.startAtBase && chart.options.horizontalBars) ? data.x1 : data.x2) + options.labelOffset.x,
y: ((options.startAtBase && ~chart.options.horizontalBars) ? data.y1 : data.y2) + options.labelOffset.y,
style: 'text-anchor: ' + options.textAnchor
}, [options.labelClass, indexClass, thresholdClass].join(' ')).text(options.labelInterpolationFnc(barValue));
}
Expand Down

0 comments on commit 80289c4

Please sign in to comment.