Skip to main content

Plot / Line / Step

Make a line plot with a step curve.

from synth import FakeTimeSeriesfrom h2o_wave import site, data, ui
page = site['/demo']
n = 50f = FakeTimeSeries()v = page.add('example', ui.plot_card(    box='1 1 4 5',    title='Line, step',    data=data('date price', n),    plot=ui.plot([ui.mark(type='line', x_scale='time', x='=date', y='=price', curve='step', y_min=0)])))
v.data = [(t, x) for t, x, dx in [f.next() for _ in range(n)]]
page.save()

Tags: โ€‚plot