Search 1.9 billion lines of Odoo code on GitHub

web_widget_json_graph

Author: Vauxoo, Odoo Community Association (OCA)
License: LGPL-3
Branch: 15.0
Repository: AITIC/web
Dependencies: web
Languages: HTML (415, 65.3%), JavaScript (26, 4.1%), Python (28, 4.4%), XML (6, 0.9%), and reStructuredText (161, 25.3%)
Other repositories: AntoniRomera/web, AyoubZahid/web, Change2improve/web, Darknroses/web, Digital5-Odoo/web, Dobtor-OCA/web, ERPLibre/web, ForgeFlow/web, GSLabIt/web, Gabinete-Digital/web, GlodoUK/oca-web, Ingeos/web, Jarsa/web, KKamaa/web, LevelPrime/web, Martronic-SA/web, MihranThalhath/web, OCA/web, SeuMarco/web, SimoRubi/web, Studio73/web, Tecnativa/web, VanMoof/web, Vauxoo/web, WilldooIT/web, aaltinisik/web, acsone/web, anhvu-sg/web, aurestic/web, bizzappdev/web, blooparksystems/web, brain-tec/web, camptocamp/web, coopiteasy/web, diggy128/web, dingguijin/web, dynapps/web, eLBati/web, ecosoft-odoo/web, factorlibre/web, focusate/web-oca, gfcapalbo/web, hbrunn/web, i-vyshnevska/web, initOS/web, jeroen7s/web, kmee/web, kos94ok-3D/web, leanhtuan1996/web, legalsylvain/web, mharenz/web, modoolar/oca-web, mohamedhagag/web, multidadosti-erp/web, onurugur/web, pegonzalezspesol/web, petrus-v/web, sergiocorato/web, sewisoft/web, solvosci/web, steingabelgaard/web, sunflowerit/web, takinobori/oca-web, tarteo/web, tegin/web, tirix/web, tirma-sa/web, trevi-software/web, trobz/web, tvtma/web, unitek-solusi/OCA-web, ursais/web, vialaurea/OCA-web, xcgd/web, zarumaru/web, and zcyuefan/web

<h1 class="title">Web Widget JSON Graph</h1> <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_json_graph"><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_json_graph"><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> <p>This module allows to load a line graph per ordered pair from an One2many or Many2many field.</p> <img alt="Widget in action" src="https://raw.githubusercontent.com/OCA/web/15.0/web_widget_json_graph/static/description/widget_in_action.png" style="width: 400px;" /> <p><strong>Table of contents</strong></p> <div class="contents local topic" id="contents"> <ul class="simple"> <li><a class="reference internal" href="#usage" id="id1">Usage</a></li> <li><a class="reference internal" href="#known-issues-roadmap" id="id2">Known issues / Roadmap</a></li> <li><a class="reference internal" href="#bug-tracker" id="id3">Bug Tracker</a></li> <li><a class="reference internal" href="#credits" id="id4">Credits</a><ul> <li><a class="reference internal" href="#authors" id="id5">Authors</a></li> <li><a class="reference internal" href="#contributors" id="id6">Contributors</a></li> <li><a class="reference internal" href="#other-credits" id="id7">Other credits</a></li> <li><a class="reference internal" href="#maintainers" id="id8">Maintainers</a></li> </ul> </li> </ul> </div> <a name="usage"></a> <h2><a class="toc-backref" href="#id1">Usage</a></h2> <p>Use this widget by including:</p> <pre> <code>&lt;field name=&quot;field_text_json&quot; widget=&quot;json_graph&quot; /&gt;</code> </pre> <p>For example:</p> <pre> <code>&lt;field name=&quot;values_data&quot; widget=&quot;json_graph&quot;/&gt;</code> </pre> <p>The JSON needs to be like:</p> <pre> <code>info = { &quot;type&quot;: &quot;line&quot;, &quot;data&quot;: {&quot;datasets&quot;: [], &quot;labels&quot;: []}, &quot;options&quot;: { &quot;scales&quot;: { &quot;yAxes&quot;: [ { &quot;ticks&quot;: {&quot;beginAtZero&quot;: True, &quot;stacked&quot;: False}, &quot;scaleLabel&quot;: {&quot;display&quot;: True, &quot;labelString&quot;: &quot;Quantity&quot;}, } ], &quot;xAxes&quot;: [ { &quot;scaleLabel&quot;: {&quot;display&quot;: True, &quot;labelString&quot;: &quot;Date&quot;}, } ], }, &quot;elements&quot;: {&quot;point&quot;: {&quot;radius&quot;: 3}}, &quot;legend&quot;: {&quot;labels&quot;: {&quot;usePointStyle&quot;: True}}, &quot;tooltips&quot;: {&quot;intersect&quot;: False, &quot;axis&quot;: &quot;xy&quot;, &quot;mode&quot;: &quot;index&quot;}, }, } self.field_text_json = json.dumps(info)</code> </pre> <p>For example:</p> <pre> <code>plot_dataset = [1, 2, 3, 4, 3, 2] labels = [&quot;Jan&quot;, &quot;Feb&quot;, &quot;Mar&quot;, &quot;Apr&quot;, &quot;May&quot;, &quot;Jun&quot;] info = { &quot;type&quot;: &quot;line&quot;, &quot;data&quot;: {&quot;datasets&quot;: plot_dataset, &quot;labels&quot;: labels}, &quot;options&quot;: { &quot;scales&quot;: { &quot;yAxes&quot;: [ { &quot;ticks&quot;: {&quot;beginAtZero&quot;: True, &quot;stacked&quot;: False}, &quot;scaleLabel&quot;: {&quot;display&quot;: True, &quot;labelString&quot;: &quot;Quantity&quot;}, } ], &quot;xAxes&quot;: [ { &quot;scaleLabel&quot;: {&quot;display&quot;: True, &quot;labelString&quot;: &quot;Date&quot;}, } ], }, &quot;elements&quot;: {&quot;point&quot;: {&quot;radius&quot;: 3}}, &quot;legend&quot;: {&quot;labels&quot;: {&quot;usePointStyle&quot;: True}}, &quot;tooltips&quot;: {&quot;intersect&quot;: False, &quot;axis&quot;: &quot;xy&quot;, &quot;mode&quot;: &quot;index&quot;}, }, } self.values_data = json.dumps(info)</code> </pre> <p>For more information, please see <cite>Chart Js Documentation &lt;https://www.chartjs.org/docs/2.9.4/&gt;</cite>.</p> <a name="known-issues-roadmap"></a> <h2><a class="toc-backref" href="#id2">Known issues / Roadmap</a></h2> <ul class="simple"> <li>None</li> </ul> <a name="bug-tracker"></a> <h2><a class="toc-backref" href="#id3">Bug Tracker</a></h2> <p>Bugs are tracked on <a class="reference external" href="https://github.com/OCA/web/issues">GitHub Issues</a>. In case of trouble, please check there if your issue has already been reported. If you spotted it first, help us smashing it by providing a detailed and welcomed <a class="reference external" href="https://github.com/OCA/web/issues/new?body=module:%20web_widget_json_graph%0Aversion:%2015.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p> <p>Do not contact contributors directly about support or help with technical issues.</p> <a name="credits"></a> <h2><a class="toc-backref" href="#id4">Credits</a></h2> <a name="authors"></a> <h3><a class="toc-backref" href="#id5">Authors</a></h3> <ul class="simple"> <li>Vauxoo</li> </ul> <a name="contributors"></a> <h3><a class="toc-backref" href="#id6">Contributors</a></h3> <ul class="simple"> <li>Francisco Luna &lt;<a class="reference external" href="mailto:fluna&#64;vauxoo.com">fluna&#64;vauxoo.com</a>&gt;</li> <li>José Robles &lt;<a class="reference external" href="mailto:josemanuel&#64;vauxoo.com">josemanuel&#64;vauxoo.com</a>&gt;</li> <li>Luis González &lt;<a class="reference external" href="mailto:lgonzalez&#64;vauxoo.com">lgonzalez&#64;vauxoo.com</a>&gt;</li> <li>Nhomar Hernández &lt;<a class="reference external" href="mailto:nhomar&#64;vauxoo.com">nhomar&#64;vauxoo.com</a>&gt;</li> </ul> <a name="other-credits"></a> <h3><a class="toc-backref" href="#id7">Other credits</a></h3> <p>Vauxoo</p> <a name="maintainers"></a> <h3><a class="toc-backref" href="#id8">Maintainers</a></h3> <p>This module is maintained by the OCA.</p> <a class="reference external image-reference" href="https://odoo-community.org"><img alt="Odoo Community Association" src="https://odoo-community.org/logo.png" /></a> <p>OCA, or the Odoo Community Association, is a nonprofit organization whose mission is to support the collaborative development of Odoo features and promote its widespread use.</p> <p>Current <a class="reference external" href="https://odoo-community.org/page/maintainer-role">maintainers</a>:</p> <p><a class="reference external" href="https://github.com/luisg123v"><img alt="luisg123v" src="https://github.com/luisg123v.png?size=40px" /></a> <a class="reference external" href="https://github.com/frahikLV"><img alt="frahikLV" src="https://github.com/frahikLV.png?size=40px" /></a></p> <p>This module is part of the <a class="reference external" href="https://github.com/OCA/web/tree/15.0/web_widget_json_graph">OCA/web</a> project on GitHub.</p> <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>