是的,您可以使用 Chart.js 配置工具提示以获得与您引用的图表类似的行为。
欲了解更多信息,请查看mode http://www.chartjs.org/docs/#chart-configuration-tooltip-configuration工具提示配置选项和hover http://www.chartjs.org/docs/#chart-configuration-hover-configuration满足您需求的配置选项。这是一个例子。
options: {
responsive: true,
title:{
display:true,
text:'Chart.js Line Chart'
},
tooltips: {
mode: 'index',
intersect: false,
},
hover: {
mode: 'nearest',
intersect: true
},
scales: {
xAxes: [{
display: true,
scaleLabel: {
display: true,
labelString: 'Month'
}
}],
yAxes: [{
display: true,
scaleLabel: {
display: true,
},
}]
}
}
这里有一个代码笔示例 http://codepen.io/jordanwillis/pen/ZeaLGj展示与您的示例相匹配的行为。