Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/77.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Jquery 配置背景标签_Jquery_Elessar - Fatal编程技术网

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');
  }
}