python - Bokeh updating multiple lines -
from painless streaming plots bokeh shows how stream live data of single variable. how stream multiple lines there more 1 y variable.
import time bokeh.objects import glyphrenderer renderer = [r r in curplot().renderers if isinstance(r, glyphrenderer)][0] ds = renderer.data_source while true: df = pd.io.json.read_json(url+json_call) ds.data["x"] = x+n*i ds.data["y"] = df.rssi ds._dirty = true session().store_obj(ds) time.sleep(1.5) i+=1
you can update many ds.data[]
items before calling session().store_objs(ds)
.
Comments
Post a Comment