Skip to content

Commit

Permalink
Fixed issue with higher ranks X axis labels not being applied to the …
Browse files Browse the repository at this point in the history
…last label. Closes #1760. Related to #1649.
  • Loading branch information
TorsteinHonsi committed Apr 24, 2013
1 parent 6c99c70 commit f058c07
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 21 deletions.
16 changes: 9 additions & 7 deletions js/highcharts.src.js
Expand Up @@ -782,23 +782,25 @@ function getTimeTicks(normalizedInterval, min, max, startOfWeek) {

// else, the interval is fixed and we use simple addition
} else {

// mark new days if the time is dividable by day
if (interval <= timeUnits[HOUR] && time % timeUnits[DAY] === timezoneOffset) {
higherRanks[time] = DAY;
}

time += interval * count;

}

i++;
}

// push the last time
tickPositions.push(time);


// mark new days if the time is dividible by day (#1649, #1760)
each(grep(tickPositions, function (time) {
return interval <= timeUnits[HOUR] && time % timeUnits[DAY] === timezoneOffset;
}), function (time) {
higherRanks[time] = DAY;
});
}


// record information on the chosen unit - for dynamic label formatter
tickPositions.info = extend(normalizedInterval, {
higherRanks: higherRanks,
Expand Down
16 changes: 9 additions & 7 deletions js/highstock.src.js
Expand Up @@ -782,23 +782,25 @@ function getTimeTicks(normalizedInterval, min, max, startOfWeek) {

// else, the interval is fixed and we use simple addition
} else {

// mark new days if the time is dividable by day
if (interval <= timeUnits[HOUR] && time % timeUnits[DAY] === timezoneOffset) {
higherRanks[time] = DAY;
}

time += interval * count;

}

i++;
}

// push the last time
tickPositions.push(time);


// mark new days if the time is dividible by day (#1649, #1760)
each(grep(tickPositions, function (time) {
return interval <= timeUnits[HOUR] && time % timeUnits[DAY] === timezoneOffset;
}), function (time) {
higherRanks[time] = DAY;
});
}


// record information on the chosen unit - for dynamic label formatter
tickPositions.info = extend(normalizedInterval, {
higherRanks: higherRanks,
Expand Down
16 changes: 9 additions & 7 deletions js/parts/Utilities.js
Expand Up @@ -661,23 +661,25 @@ function getTimeTicks(normalizedInterval, min, max, startOfWeek) {

// else, the interval is fixed and we use simple addition
} else {

// mark new days if the time is dividable by day
if (interval <= timeUnits[HOUR] && time % timeUnits[DAY] === timezoneOffset) {
higherRanks[time] = DAY;
}

time += interval * count;

}

i++;
}

// push the last time
tickPositions.push(time);


// mark new days if the time is dividible by day (#1649, #1760)
each(grep(tickPositions, function (time) {
return interval <= timeUnits[HOUR] && time % timeUnits[DAY] === timezoneOffset;
}), function (time) {
higherRanks[time] = DAY;
});
}


// record information on the chosen unit - for dynamic label formatter
tickPositions.info = extend(normalizedInterval, {
higherRanks: higherRanks,
Expand Down

0 comments on commit f058c07

Please sign in to comment.