在 select 日期选择器值上动态显示 Morrise.js 悬停标签

Dynamic Show Morrise.js Hover Label On select datepicker value

我需要在更改日历上的月份时它反映在统计图表中以显示线和所选蛾的数量. 我使用 "bootstrap date-picker" 如果您有其他图表建议,请告诉我。

像这样:

图片

1- 在日期选择器中选择日期时,在数据提供程序中查找所选日期的索引。

2- 使用 morris.displayHoverForRow(index) 方法将鼠标悬停在该项目上。

工作代码:http://jsfiddle.net/ercanpeker/t6ygeud0/

注意:我使用了 jQuery UI 日期选择器。

如果有人使用引导程序日期选择器,那是我的代码:

 $("#calendar").datepicker({
  format: "dd MM yyyy",
})
.on('changeDate', function (e) {
  currMonth = months[new Date(e.date).getMonth()];
  console.log(currMonth);
  var index = e.date.getMonth()
  if (index != -1) {
    _chart.displayHoverForRow(index)
  }

});