我的问题是到目前为止我还没有找到任何可以在我的图表上同步显示十字准线的解决方案。虽然,我在这里找到了解决我的问题的方法:
https://www.syncfusion.com/forums/164787/synchronise-crosshair-trackball-in-multiple-charts
但它使用像素化显示十字准线。我需要一个解决方案,我可以同时通过 X 坐标绘制十字准线(其中 X 是日期)
public syncronisedCrosshair(args: IMouseEventArgs, id: string): void {
if(id == "charts"){
this.mousemoveEvent( document.getElementById("charts1"), args.x, window.screenTop+0, args.x, window.screenTop+90-window.scrollY);
this.mousemoveEvent( document.getElementById("charts2"), args.x, window.screenTop+0, args.x, window.screenTop+610-window.scrollY);
this.mousemoveEvent( document.getElementById("charts3"), args.x, window.screenTop+0, args.x, window.screenTop+920-window.scrollY);
this.mousemoveEvent( document.getElementById("charts4"), args.x, window.screenTop+0, args.x, window.screenTop+1230-window.scrollY);
this.mousemoveEvent( document.getElementById("charts5"), args.x, window.screenTop+0, args.x, window.screenTop+1540-window.scrollY);
}
}
private mousemoveEvent(element, sx, sy, cx, cy) {
let mousemove = document.createEvent("MouseEvent");
mousemove.initMouseEvent( "mousemove", true, false, window, 1, sx, sy, cx, cy, false, false, false, false, 0, null);
element.dispatchEvent(mousemove);
}