OCA reporting engine fork for dev and update.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

24 lines
888 B

#. Access `Dashboards > Configuration > KPI Dashboards > Configure KPI`
#. Create a new KPI specifying with widget type `bokeh`
In order to define the value, you can must define a function like::
from bokeh.plotting import figure
from bokeh.embed import components
def test_demo_bokeh(self):
p = figure(width=1000, height=1000, sizing_mode="scale_both")
# import that as `from bokeh.plotting import figure`
p.line([0, 1, 2], [1, 10, random.random() * 10], line_width=5)
# (...)
# fill the record field with both markup and the script of a chart.
script, div = components(p)
return {"bokeh": "%s%s" % (div, script)}
You can also use `code`. The following items will be added automatically to the
code items:
* `figure`
* `components`
* `simple_components`: Like components but adds a theme with no alpha background