Question

I need to changes background labels in Elessar, does anyone know the parameter to changes the default values? It's actually showing in the format YYYY-MM-DD HH:mm, and I only need HH:mm.

Was it helpful?

Solution

Since version 1.7, there's a new bgMarks option:

bgMarks: {
  count: 0, // number of value labels to write in the background of the bar
  interval: Infinity, // provide instead of count to specify the space between labels
  label: id // string or function to write as the text of a label. functions are called with normalised values.
}

For your use case, you'd want (assuming you're using Moment.js):

bgMarks: {
  count: 4,
  label: function(val) {
    return moment(val).format('HH:mm');
  }
}
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top