当前数据通过dimple.js以折线图的形式显示。如果年份显示相同的值数据,则这些点重叠。在这种情况下,当我将鼠标移到该点时,我想显示所有重叠数据的工具提示。我该怎么办?
您需要像这样处理mouseover
对象的Series
事件,
mySeries.addEventHandler("mouseover", function (e){
var xValue = e.xValue; // e.xValue returns X Axis value of hovered data point
var yValue = e.yValue; // e.yValue returns Y Axis value of hovered data point
// Filter your data with both xValue and yValue, to find overlapped `series` data.
});
此示例演示了如何覆盖默认工具提示,可能也会对您有所帮助http://dimplejs.org/advanced_examples_viewer.html?id=advanced_custom_styling