Jquery 配置背景标签
我需要在中更改背景标签,是否有人知道要更改默认值的参数?Jquery 配置背景标签,jquery,elessar,Jquery,Elessar,我需要在中更改背景标签,是否有人知道要更改默认值的参数? 它实际上是以YYYY-MM-DD HH:MM格式显示的,我只需要HH:MM自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 be
它实际上是以
YYYY-MM-DD HH:MM
格式显示的,我只需要HH:MM
自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.
}
对于您的用例,您希望(假设您使用的是矩.js):
你能展示一下你现在有什么吗?如果我设置参数bgLabels:4,会出现背景标签(本例中为4),但格式为YYYY-MM-DD HH:SSI只是想补充一点,项目GitHub页面上的API描述似乎不正确,实际的属性名称是
bgMark
,而不是复数bgMarks
。您可以在下面的源代码中看到
bgMarks: {
count: 4,
label: function(val) {
return moment(val).format('HH:mm');
}
}