amcharts - Keeping scrollbar in same position live chart -


when creating live chart in amcharts (example: http://jsfiddle.net/amcharts/atqum/) seems when 1 triggers this.state.chart.validatedata() scope of scrollbar being reset full-scope unless user clicks , holds down scrollbar in same position.

is there way keep scope data being updated, without holding button down?

assuming want date selection persist between updates, can set zoomoutondataupdate false in chart object , scrollbar stay on selected date range; example, if you're zoomed on 2017-07-01 through 2017-08-01, date range still in view between updates.

demo

if you're sliding old points off chart in demo, zoomoutondataupdate doesn't quite work out, ui-wise, since date range fall off points removed, you'll notice in above demo (the right scrollbar handle moving left). in instance, you'll want maintain chart's current startindex , endindex , call zoomtoindexes after update, i.e.

    var startindex = chart.startindex;     var endindex = chart.endindex;     chart.validatedata();     chart.zoomtoindexes(startindex, endindex); 

demo

fyi, fiddle linked uses older version of amcharts (v2). fiddles using latest v3 release.


Comments

Popular posts from this blog

python Tkinter Capturing keyboard events save as one single string -

android - InAppBilling registering BroadcastReceiver in AndroidManifest -

javascript - Z-index in d3.js -