Black Lives Matter. Please consider donating to Black Girls Code today.

Dynamically modify the Range

Hi,

I am using heatmap with streaming data.
I use y-axis range [0,600] as default.
Every 30sec data is straming, showing only 500 records of data.
After long time, data is not with in the range of [0,600].
The range gets updated to [1000,1500].
https://jsfiddle.net/1yLavejg/33/
pl observe this fiddle after updating the data rt side of the chart is looking empty.
But if we scroll up there is a chart.How can I update the range dynamically after streaming.

Pl help me.

Thx
Lavanya

1 Like

How are you streaming your graph? Using restyle, extendTraces or something else?

Hi,

I am using extendTraces.

This is my code

    	var update ={	  
			   x:[x],
			   y:[y],
			   z:[z],
			   text:[tiptext],
	 };

Plotly.extendTraces(divname, update, [0],500);

Appending new data to old data. Based on chart data I need to change the range.

Thanks In Advance.
Regards
Lavanya.

Ah I see. The only way I can think of is to call Plotly.relayout(divname, 'yaxis.range', [/* new range /*]) after you extendTraces call.

Thanks a lot. Its working fine.