这个小部件允许使用bokeh库显示图表。
odoo12-addon-web-widget-bokeh-chart的Python项目详细描述
本模块增加了将bokeh图表插入odoo标准视图的可能性。
Bokeh是python交互式可视化 以现代Web浏览器为显示目标的库。它的目标是 提供优雅、简洁的基本探索和先进的建设 自定义d3.js风格的图形,但也提供了这种功能 在非常大的或流式数据集上的高性能交互。波基 可以帮助任何想快速轻松地创建交互的人 绘图、仪表板和数据应用程序。
如果您想查看bokeh的一些功能示例,请遵循以下link。
目录
Usage
要在视图中插入bokeh图表,请执行以下操作:
声明一个文本计算字段,如下所示:
bokeh_chart = fields.Text( string='Bokeh Chart', compute='_compute_bokeh_chart', )
在其计算方法中,do:
def _compute_bokeh_chart(self): for rec in self: # Design your bokeh figure: p = figure() # import that as `from bokeh.plotting import figure` line = p.line([0, 2], [1, 8], line_width=5) # (...) # fill the record field with both markup and the script of a chart. script, div = components(p) rec.bokeh_chart = '%s%s' % (div, script)
在视图中,在您希望显示 波基图:
<div> <field name="bokeh_chart" widget="bokeh_chart" nolabel="1"/> </div>
Credits
Contributors
- 乔迪芭蕾舞演员阿洛玛jordi.ballester@eficent.com>;
- 露易丝·里洛·安泰洛,lois.rilo@eficent.com>;
- 阿泰姆克斯特尤克<;a.kostyuk@mobilunity.com>;
Other credits
- 此模块使用库Bokeh 在开源bsd 3条款“新”或“修订”许可下。 版权所有(c)2012,Anaconda,Inc.
- 奥多社区协会(OCA)
Maintainers
此模块由OCA维护。
oca,或odoo社区协会,是一个非营利性组织 任务是支持odoo特性和 促进其广泛应用。
这个模块是github上OCA/web项目的一部分。
欢迎您的贡献。要了解如何访问https://odoo-community.org/page/Contribute。