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

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