Skip to content

Commit

Permalink
Improved error message for zero or subzero values on log axis. Closes #…
Browse files Browse the repository at this point in the history
  • Loading branch information
highslide-software committed Feb 28, 2012
1 parent b2893bb commit c82e024
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions js/highcharts.src.js
Expand Up @@ -6348,8 +6348,8 @@ function Chart(options, callback) {
}

if (isLog) {
if (!secondPass && min <= 0) {
error(10); // Can't plot negative values on log axis
if (!secondPass && mathMin(min, dataMin) <= 0) {
error(10, 1); // Can't plot negative values on log axis
}
min = log2lin(min);
max = log2lin(max);
Expand Down
4 changes: 2 additions & 2 deletions js/highstock.src.js
Expand Up @@ -6348,8 +6348,8 @@ function Chart(options, callback) {
}

if (isLog) {
if (!secondPass && min <= 0) {
error(10); // Can't plot negative values on log axis
if (!secondPass && mathMin(min, dataMin) <= 0) {
error(10, 1); // Can't plot negative values on log axis
}
min = log2lin(min);
max = log2lin(max);
Expand Down
4 changes: 2 additions & 2 deletions js/parts/Chart.js
Expand Up @@ -1235,8 +1235,8 @@ function Chart(options, callback) {
}

if (isLog) {
if (!secondPass && min <= 0) {
error(10); // Can't plot negative values on log axis
if (!secondPass && mathMin(min, dataMin) <= 0) {
error(10, 1); // Can't plot negative values on log axis
}
min = log2lin(min);
max = log2lin(max);
Expand Down

0 comments on commit c82e024

Please sign in to comment.