3
3
< html xmlns ="http://www.w3.org/1999/xhtml " xml:lang ="en " lang ="en ">
4
4
< head >
5
5
< meta http-equiv ="Content-Type " content ="text/html; charset=utf-8 " />
6
- < meta name ="generator " content ="Docutils 0.15.1 : http://docutils.sourceforge.net/ " />
6
+ < meta name ="generator " content ="Docutils: http://docutils.sourceforge.net/ " />
7
7
< title > Web Widget mpld3 Chart</ title >
8
8
< style type ="text/css ">
9
9
@@ -367,7 +367,7 @@ <h1 class="title">Web Widget mpld3 Chart</h1>
367
367
!! This file is generated by oca-gen-addon-readme !!
368
368
!! changes will be overwritten. !!
369
369
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
370
- < p > < a class ="reference external " href ="https://odoo-community.org/page/development-status "> < img alt ="Beta " src ="https://img.shields.io/badge/maturity-Beta-yellow.png " /> </ a > < a class ="reference external " href ="http://www.gnu.org/licenses/lgpl-3.0-standalone.html "> < img alt ="License: LGPL-3 " src ="https://img.shields.io/badge/licence-LGPL--3-blue.png " /> </ a > < a class ="reference external " href ="https://github.com/OCA/web/tree/14 .0/web_widget_mpld3_chart "> < img alt ="OCA/web " src ="https://img.shields.io/badge/github-OCA%2Fweb-lightgray.png?logo=github " /> </ a > < a class ="reference external " href ="https://translation.odoo-community.org/projects/web-14 -0/web-14 -0-web_widget_mpld3_chart "> < img alt ="Translate me on Weblate " src ="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png " /> </ a > < a class ="reference external " href ="https://runbot.odoo-community.org/runbot/162/14 .0 "> < img alt ="Try me on Runbot " src ="https://img.shields.io/badge/runbot-Try%20me-875A7B.png " /> </ a > </ p >
370
+ < p > < a class ="reference external " href ="https://odoo-community.org/page/development-status "> < img alt ="Beta " src ="https://img.shields.io/badge/maturity-Beta-yellow.png " /> </ a > < a class ="reference external " href ="http://www.gnu.org/licenses/lgpl-3.0-standalone.html "> < img alt ="License: LGPL-3 " src ="https://img.shields.io/badge/licence-LGPL--3-blue.png " /> </ a > < a class ="reference external " href ="https://github.com/OCA/web/tree/15 .0/web_widget_mpld3_chart "> < img alt ="OCA/web " src ="https://img.shields.io/badge/github-OCA%2Fweb-lightgray.png?logo=github " /> </ a > < a class ="reference external " href ="https://translation.odoo-community.org/projects/web-15 -0/web-15 -0-web_widget_mpld3_chart "> < img alt ="Translate me on Weblate " src ="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png " /> </ a > < a class ="reference external " href ="https://runbot.odoo-community.org/runbot/162/15 .0 "> < img alt ="Try me on Runbot " src ="https://img.shields.io/badge/runbot-Try%20me-875A7B.png " /> </ a > </ p >
371
371
< p > This module adds the possibility to insert mpld3 charts into Odoo standard views.
372
372
This is an interactive D3js-based viewer which brings matplotlib graphics to the browser.</ p >
373
373
< p > If you want to see some samples of mpld3’s capabilities follow this < a class ="reference external " href ="http://mpld3.github.io/ "> link</ a > .</ p >
@@ -397,9 +397,15 @@ <h1><a class="toc-backref" href="#id1">Installation</a></h1>
397
397
< h1 > < a class ="toc-backref " href ="#id2 "> Usage</ a > </ h1 >
398
398
< p > To insert a mpld3 chart in a view proceed as follows:</ p >
399
399
< ol class ="arabic ">
400
+ < li > < p class ="first "> You should inherit from abstract class abstract.mpld3.parser:</ p >
401
+ < pre class ="literal-block ">
402
+ _name = 'res.partner'
403
+ _inherit = ['res.partner', 'abstract.mpld3.parser']
404
+ </ pre >
405
+ </ li >
400
406
< li > < p class ="first "> Import the required libraries:</ p >
401
407
< pre class ="literal-block ">
402
- import matplotlib.pyplot as plt, mpld3
408
+ import matplotlib.pyplot as plt
403
409
</ pre >
404
410
</ li >
405
411
< li > < p class ="first "> Declare a text computed field like this:</ p >
@@ -417,7 +423,7 @@ <h1><a class="toc-backref" href="#id2">Usage</a></h1>
417
423
# Design your mpld3 figure:
418
424
plt.scatter([1, 10], [5, 9])
419
425
figure = plt.figure()
420
- rec.mpld3_chart = mpld3.fig_to_html (figure)
426
+ rec.mpld3_chart = self.convert_figure_to_json (figure)
421
427
</ pre >
422
428
</ li >
423
429
< li > < p class ="first "> In the view, add something like this wherever you want to display your
@@ -435,7 +441,7 @@ <h1><a class="toc-backref" href="#id3">Bug Tracker</a></h1>
435
441
< p > Bugs are tracked on < a class ="reference external " href ="https://github.com/OCA/web/issues "> GitHub Issues</ a > .
436
442
In case of trouble, please check there if your issue has already been reported.
437
443
If you spotted it first, help us smashing it by providing a detailed and welcomed
438
- < a class ="reference external " href ="https://github.com/OCA/web/issues/new?body=module:%20web_widget_mpld3_chart%0Aversion:%2014 .0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior** "> feedback</ a > .</ p >
444
+ < a class ="reference external " href ="https://github.com/OCA/web/issues/new?body=module:%20web_widget_mpld3_chart%0Aversion:%2015 .0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior** "> feedback</ a > .</ p >
439
445
< p > Do not contact contributors directly about support or help with technical issues.</ p >
440
446
</ div >
441
447
< div class ="section " id ="credits ">
@@ -450,6 +456,7 @@ <h2><a class="toc-backref" href="#id5">Authors</a></h2>
450
456
< h2 > < a class ="toc-backref " href ="#id6 "> Contributors</ a > </ h2 >
451
457
< ul class ="simple ">
452
458
< li > Jordi Ballester Alomar << a class ="reference external " href ="mailto:jordi.ballester@forgeflow.com "> jordi.ballester@forgeflow.com</ a > ></ li >
459
+ < li > Christopher Ormaza << a class ="reference external " href ="mailto:chris.ormaza@forgeflow.com "> chris.ormaza@forgeflow.com</ a > ></ li >
453
460
</ ul >
454
461
</ div >
455
462
< div class ="section " id ="other-credits ">
@@ -468,7 +475,9 @@ <h2><a class="toc-backref" href="#id8">Maintainers</a></h2>
468
475
< p > OCA, or the Odoo Community Association, is a nonprofit organization whose
469
476
mission is to support the collaborative development of Odoo features and
470
477
promote its widespread use.</ p >
471
- < p > This module is part of the < a class ="reference external " href ="https://github.com/OCA/web/tree/14.0/web_widget_mpld3_chart "> OCA/web</ a > project on GitHub.</ p >
478
+ < p > Current < a class ="reference external " href ="https://odoo-community.org/page/maintainer-role "> maintainers</ a > :</ p >
479
+ < p > < a class ="reference external " href ="https://github.com/JordiBForgeFlow "> < img alt ="JordiBForgeFlow " src ="https://github.com/JordiBForgeFlow.png?size=40px " /> </ a > < a class ="reference external " href ="https://github.com/ChrisOForgeFlow "> < img alt ="ChrisOForgeFlow " src ="https://github.com/ChrisOForgeFlow.png?size=40px " /> </ a > </ p >
480
+ < p > This module is part of the < a class ="reference external " href ="https://github.com/OCA/web/tree/15.0/web_widget_mpld3_chart "> OCA/web</ a > project on GitHub.</ p >
472
481
< p > You are welcome to contribute. To learn how please visit < a class ="reference external " href ="https://odoo-community.org/page/Contribute "> https://odoo-community.org/page/Contribute</ a > .</ p >
473
482
</ div >
474
483
</ div >
0 commit comments