When using our API to simulate a live feed of the data using methods (setseriesdata, appendseriesvalues, addnode etc..) the chart updates and the crosshair disappears. You can easily remedy this with our API.
Non Sticky Crosshair
If you have no idea what I'm talking about, hover your mouse over the following chart.
Sticky Crosshair
// global value used between functions
var guide_scale_keyvalue = null;
/*
* register all movements of the crosshair
*/
zingchart.bind('zc', 'guide_mousemove', function(p) {
if (p.items.length) {
guide_scale_keyvalue = p.items[0].keyvalue;
}
});
/*
* register all movements of the crosshair
*/
zingchart.bind('zc', 'guide_mouseout', function(p) {
guide_scale_keyvalue = null;
});
/*
* Everytime the chart finishes rendering from appendseriesvalues
* set the guid to appear at the last position is was
*/
zingchart.bind('zc', 'complete', function() {
if (guide_scale_keyvalue) {
zingchart.exec('zc', 'setguide', {
keyvalue : guide_scale_keyvalue
});
}
});