novus / nvd3

A reusable charting library written in d3.js
http://nvd3.org/
Other
7.22k stars 2.15k forks source link

Lock focus mode for realtime data scrolling #1309

Open mindjuice opened 8 years ago

mindjuice commented 8 years ago

I have a realtime graph of type lineWithFocusChart where new data is added every second. When the data is added, the focus rect in the small graph moves over to the left and the main graph stays the same.

Is it possible to lock the focus mode to the right side so that the user can view a zoomed in version of the data in the main graph while seeing the full view in the smaller one? Then when new data is received, the user would see it.

Ideally it would be possible to turn the lock on/off programatically so that if the user was viewing historical data, then I could provide a "Live" button to snap the focus to the right and view live data again.

mindjuice commented 8 years ago

I was able to implement this by setting the brushExtent to show the newest value whenever new data is received. The brushExtent is just an array of two values that are in the range of the x axis (timestamps in my case).

Would still be nice to have this implemented natively though. I'll try to find time this month to do that.

liquidpele commented 8 years ago

Oh, that would be nice, looking forward to your pull request then :)