配置背景标签

时间:2014-03-30 04:50:57

标签: jquery elessar

我需要更改Elessar中的背景标签,是否有人知道更改默认值的参数? 它实际上以YYYY-MM-DD HH:mm格式显示,我只需要HH:mm

1 个答案:

答案 0 :(得分:1)

从版本1.7开始,有一个新的bgMarks选项:

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.
}

对于您的用例,您需要(假设您正在使用Moment.js):

bgMarks: {
  count: 4,
  label: function(val) {
    return moment(val).format('HH:mm');
  }
}