Skip to content

Commit

Permalink
Addition to fix for bug #287; inverted charts treated by align=right.
Browse files Browse the repository at this point in the history
  • Loading branch information
Erik Olsson committed Jul 6, 2011
1 parent 3de8d19 commit 91f0203
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
5 changes: 5 additions & 0 deletions js/highcharts.src.js
Expand Up @@ -9415,6 +9415,11 @@ Series.prototype = {
x += { left: -1, right: 1 }[align] * point.barW / 2 || 0;
}

if (inverted && point.y < 0) {
align = 'right';
x -= 10;
}

// update existing label
if (dataLabel) {
// vertically centered
Expand Down
5 changes: 5 additions & 0 deletions js/parts/Series.js
Expand Up @@ -1245,6 +1245,11 @@ Series.prototype = {
x += { left: -1, right: 1 }[align] * point.barW / 2 || 0;
}

if (inverted && point.y < 0) {
align = 'right';
x -= 10;
}

// update existing label
if (dataLabel) {
// vertically centered
Expand Down

0 comments on commit 91f0203

Please sign in to comment.