Skip to content

Commit

Permalink
Multiline support for axes using \n
Browse files Browse the repository at this point in the history
You can format momentjs times in axes using [\n] moment/moment#1158
  • Loading branch information
bielitom committed Aug 16, 2016
1 parent 349a8a3 commit 3d9f3f9
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/scales/scale.time.js
Expand Up @@ -320,6 +320,9 @@ module.exports = function(Chart) {
// Function to format an individual tick mark
tickFormatFunction: function(tick, index, ticks) {
var formattedTick = tick.format(this.displayFormat);
if(formattedTick.indexOf("\n")>0){
formattedTick = formattedTick.split("\n");
}
var tickOpts = this.options.ticks;
var callback = helpers.getValueOrDefault(tickOpts.callback, tickOpts.userCallback);

Expand Down

0 comments on commit 3d9f3f9

Please sign in to comment.