Anychart fromJson:绘制图表后设置Line Marker出现报错问题
Hey folks,
I’ve been troubleshooting a frustrating issue with AnyChart’s lineMarkers for a while now: whenever I hover over series data points, my console gets flooded with NaN errors. After testing different setup flows, I’ve tracked down what’s causing it:
- If I initialize a chart from a JSON config, then call
chart.draw()before configuringlineMarkers, the NaN errors pop up on hover. - But if I build the exact same chart using direct API calls, the order of
chart.draw()andlineMarkerssetup doesn’t affect anything—no errors at all.
I put together side-by-side test cases to demonstrate the difference (same chart structure, just different initialization methods). The JSON-based one with the wrong order throws errors, while the API-built version works perfectly.
I’ve already got a workaround: when using JSON, I just set up the lineMarkers first, then call chart.draw() afterward, and the errors go away. But I’m wondering—is this a legitimate bug in AnyChart’s JSON initialization handling, or is there some intended behavior I’m missing here?
Thanks for any insight you can provide!
内容的提问来源于stack exchange,提问作者Synapticon

