mirror of
https://github.com/OCA/reporting-engine.git
synced 2025-02-16 16:30:38 +02:00
[12.0][ADD] kpi_dashboard_bokeh
This commit is contained in:
24
kpi_dashboard_bokeh/readme/CONFIGURE.rst
Normal file
24
kpi_dashboard_bokeh/readme/CONFIGURE.rst
Normal file
@@ -0,0 +1,24 @@
|
||||
#. 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
|
||||
1
kpi_dashboard_bokeh/readme/CONTRIBUTORS.rst
Normal file
1
kpi_dashboard_bokeh/readme/CONTRIBUTORS.rst
Normal file
@@ -0,0 +1 @@
|
||||
* Enric Tobella <etobella@creublanca.es>
|
||||
1
kpi_dashboard_bokeh/readme/DESCRIPTION.rst
Normal file
1
kpi_dashboard_bokeh/readme/DESCRIPTION.rst
Normal file
@@ -0,0 +1 @@
|
||||
Define KPI dashboard graphs using bokeh.
|
||||
Reference in New Issue
Block a user