When user hovers the mouse on the #chart
, then second data is drawn.
However I would like to know when user hovers the mouse on the first data line by itself not #chart then second data line is drawn.
function createChart() {
$("#chart")
.kendoChart({
xAxis: {},
yAxis: {},
seriesDefaults: {type: "scatterLine" },
series: [{data: stats2},{name:"gmail"}],
})
}
var isHover = false;
$("#chart").hover(
function () {
if (!isHover) {
var chart = $("#chart").data().kendoChart;
chart.options.series[0].data = stats2;
chart.options.series[0].name="yahoo";
chart.redraw();
isHover = true;
}
}, function () {
if (isHover) {
var chart = $("#chart").data().kendoChart;
chart.options.series[0].data = stats;
chart.options.series[0].name="";
chart.redraw();
isHover = false;
}
});
http://jsfiddle.net/epvg86qu/12/