joewalnes / smoothie

Smoothie Charts: smooooooth JavaScript charts for realtime streaming data
http://smoothiecharts.org
Other
2.25k stars 234 forks source link

Tooltip does not display when chart is stopped #121

Open eanders-ms opened 4 years ago

eanders-ms commented 4 years ago

It is difficult to read the tooltip when the chart is animating. The chart scrolls under the mouse location, changing the tooltip value. Chasing the sample is sub-optimal, so I tried stopping the chart, but when it is stopped, tooltips no longer appear.

Feature request: Keep tooltips enabled when chart is stopped.

WofWca commented 3 years ago

Workaround:

chart.stop();
const stoppedAt = Date.now();
canvas.addEventListener('mousemove', (...args) => {
  chart.mousemove(...args);
  requestAnimationFrame(() => {
    chart.render(canvas, stoppedAt);
  });
})

just the idea, not production-ready code