Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to elegantly import pyecharts into odoo #115477

Open
gotoloops opened this issue Mar 16, 2023 · 1 comment
Open

How to elegantly import pyecharts into odoo #115477

gotoloops opened this issue Mar 16, 2023 · 1 comment

Comments

@gotoloops
Copy link

Versions: 14

I want to import pyecharts to enrich the charts.

@AbdelAzizMohamedMousa
Copy link

To import Pyecharts into Odoo, you can follow these steps:

Install Pyecharts using pip or your preferred package manager:
Copy code
pip install pyecharts
Create a new module in Odoo. You can do this using the Odoo Developer mode or by creating a new directory in your addons directory with a manifest file.

Create a new Python file in your module and import Pyecharts:

scss
Copy code
from pyecharts import Line

Example code to create a simple chart

line = Line("Line Chart")
line.add("data", [1, 2, 3, 4, 5], [3, 2, 4, 5, 1])
line.render()
You can then use the Pyecharts chart in any view by embedding it in an iframe or using a custom widget.
Alternatively, you can use an existing Pyecharts wrapper for Odoo such as odoo-pyecharts or odoo_echarts. These modules provide a more streamlined way to integrate Pyecharts into Odoo and offer additional features such as data binding and chart customization options.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants