summaryrefslogtreecommitdiff
path: root/addons/web/static/src/js/views/graph
AgeCommit message (Collapse)Author
2019-04-01[IMP] web: use Chart.js in graph viewMathieu Duckerts-Antoine
It has been decided to use Chart.js instead of nvd3 to render charts. In this commit the graph view has been largely rewritten to benefit from the options offered by Chart.js. Task ID: 1946138
2019-04-01[IMP] web: graph view improvementsMathieu Duckerts-Antoine
This commit extends the support of comparison mode for the graph view and refine the tooltips and rendering in line mode. The graph view code has also been slightly refactored. Task ID: 1946138
2019-03-06[REF] web: adapt code after jQuery updateVincent Schippefilt
Part of task 1896658 Co-authored-by: Aaron Bohy <aab@odoo.com> Co-authored-by: Christophe Matthieu <chm@odoo.com> Co-authored-by: Mathieu Duckerts-Antoine <dam@odoo.com> Co-authored-by: David Monjoie <dmo@odoo.com> Co-authored-by: Martin Geubelle <mge@odoo.com> Co-authored-by: svs-odoo <svs@odoo.com> Co-authored-by: Vincent Schippefilt <vsc@odoo.com>
2019-02-26[MERGE] forward port branch saas-12.2 up to fcb972db9dcChristophe Simonis
2019-02-21[MERGE] forward port branch 12.0 up to b2db72c9d13Christophe Simonis
2019-02-21[MERGE] forward port branch 12.0 up to 84143a34b31Christophe Simonis
2019-02-21[FIX] web: several columns in line chart tooltips for large dataHiral Bhavsar
Currently tooltip goes out off the screen when the graph view (in line mode) presents a large number of groups. The present commit splits the tooltip content in three columns when the number of groups exceeds 20. This split is not done in mobile mode because it is not an appropriate in that situation. Co-authored-by: Mohammed Shekha <msh@openerp.com> Related to Task: 1917958 closes odoo/odoo#30288
2019-02-21[IMP] web: properly display min and max abs when less that 3 abs.Hiral Bhavsar
In graph line mode, min and max abs are displayed beyond the screen when there are less than 3 abs. This is happening because nvd3 fixes their text-anchor to 'middle'. The present commit fixes correctly their text-anchors to start and end respectively by using the '!important' rule (it seems difficult to do otherwise). Co-authored-by: Mohammed Shekha <msh@openerp.com> Related to Task: 1917958
2019-02-25[IMP] web: graph view legend and tooltips improvementsJuhil Somaiya
This commit ameliorates the tooltips and the legend of the graph view in its different modes (bar, line, and pie). Related task id: 1917940 Co-authored-by: Mohammed Shekha <msh@openerp.com> Co-authored-by: Mathieu Duckerts-Antoine <dam@odoo.com> closes odoo/odoo#29747
2019-02-20[IMP] web: group by more than two fields in graph viewjpr-odoo
Before this commit: select more than two groupbys in a graph view would have no impact at all if mode 'bar' or 'line' is selected. This commit allows to correctly handle more than two groupbys in all modes. Task ID: 1917948 closes odoo/odoo#29673
2019-02-14[FIX] web: first and last line chart x label shownNicolas Lempereur
The graph view displaying a line chart has had some recent changes in b23a9813202. Now it is of the full width of container but when there is less than 4 labels (thanks to c4937132a38) the first and last labels may be cut because they are by default aligned on the middle with its tick (so for the first label, the half left may be missing, and the last the half right may be missing). With this change, we align labels as expected. This could be done in CSS sheet (with `.nv-axisMin-x > text { text-transform: start!important; }`) but here it is done only in the given instance. opw-1917560 closes #31116
2019-01-31[MERGE] forward port branch 12.0 up to cb8fefa8999Christophe Simonis
2019-01-24[FIX] web: bar chart no crazy with 2 group byNicolas Lempereur
In 3d2ca8104e4 some change were introduced to the graph view. But part of it had no sense when displaying data over 2 group by. eg. if the first level has 2 groups (2018, 2019) and each second level 2 groups (Done,Cancelled), we could have: 2018/Done: 0 2018/Cancelled: 5 2019/Done: 8 2019/Cancelled: 9 this gives us two main groups [2018: 5] / [2019: 17], the code remove the 2018 because [2018/Done] is 0 so we have something odd with columns not in order, and in stacked bar chart some part of a bar at the wrong offset opw-1932517 closes #30529
2019-01-08[FIX] web: graph view translationNicolas Martinelli
The control labels 'Grouped' and 'Stacked' are not translated since they are default values from nvd3. opw-1908220 closes odoo/odoo#29975
2019-01-14[MERGE] forward port branch 12.0 up to 6a0675d36ddChristophe Simonis
2018-12-12[MERGE] forward port branch 12.0 up to 047e2b28de4Christophe Simonis
2018-12-07[REF] web: move ControlPanel inside controllers/actionsGéry Debongnie
This branch introduces a large-scale reorganization of the component tree generated by the web client. The short version is that now, the control panel is a child of the view controller and no longer a sibling. Graphically (and simplified), we go from this: webClient / | \ ... ... actionManager / \ controlPanel viewController / \ to this: webClient / | \ ... ... actionManager | viewController / | \ ControlPanelController / \ CPRenderer CPModel The motivation is that this work moves the code where it should be. Before this commit, it was kind of weird to have code in the controllers to render buttons outside of their root node (in renderButtons). Also, the action manager had to take care of coordinating search view states between view transitions. So, this work simplifies the code. It also makes it easier to extend. We see day after day that Odoo needs to take care of more complex UI needs, and in many cases, these needs were quite difficult to implement (we prefer spaghettis in our plates, not in our code). The changes in this branch should open the way to implement these features. For example, - it will now be easy to add the possibility of views (for example, the search view or a new ControlPanel view) to add custom buttons (of type action or object) in the control panel. - Another need will be to serialize/ restore the state of the search view across action boundaries (needed by the dashboard). - Another example is the possibility for views to customize easily the presence/absence of sub menus (filters/groupbys/favorites/ time range/...) - Another need is an easier way for views/client action to customize their control panel. This commit also contains a large rewrite of the search view (so it is more inline with our architecture and easier to maintain). Part of task 1893568 Co-authored-by: Aaron Bohy <aab@odoo.com> Co-authored-by: Mathieu Duckerts-Antoine <dam@odoo.com> Co-authored-by: Martin Geubelle <mge@odoo.com>
2018-12-06[FIX] web: prevent crash in line chartTejas Shahu
Before this commit: While user was opening first time line chart graph, at that time undefined label values were not being converted into undefined string due to misplace code. So it was giving traceback error After this commit: Code has been moved to proper place. Joint work with msh-odoo Issue-ID: 1882328 closes odoo/odoo#29306
2018-11-16[MERGE] forward port branch 12.0 up to bc744a1da46Christophe Simonis
2018-11-14[FIX] web: restore formview mode when coming back (breadcrumbs)Géry Debongnie
Before this commit, when the user is in a form view (edit mode) and click on a stat button, a new action is added to the action stack. When the user then comes back to the form view by clicking on the breadcrumb, it is supposed to be in readonly mode. Before this commit, this was not the case. This bug comes from the action manager refactoring, which removed the view manager. With this commit, we add a new action lifecycle method which is called when the action is restored. Note that this commit implicitely changes the semantic of actions with 'target=inline'. As far as I can tell, this only applies to the settings form view, which can easily be fixed by overriding the restore hook. closes odoo/odoo#28663
2018-10-23[REF] web: small refactoring pass on some web componentsAaron Bohy
(mainly views and ActionManager) - add missing docstrings - fix typos - correctly order functions and imports - put functions in correct sections - stop using 'event' as argument of handlers - don't call handlers directly - remove trailing spaces/tabs - move module created in stable version to its own file - follow js guidelines in general closes odoo/odoo#28024
2018-10-16[FIX] web: line chart x ticks labels overlappAdrien Dieudonne
Before this commit, we tried to hide some labels depending of the available size of the graph. However, it doesn't worked when the graph is updated. A much simpler solution is to use the scale’s automatic tick generator implemented in D3. So, in this commit, we realized that 'tickValues' is unnecessary because data are passed correctly (see 'svg.datum(data);') and labels are defined in 'ticksLabels'. There is nothing else to do. We had to remove the skipped test because 'renderEnd' is not triggered for line chart. We need to update nv.d3. We already tried to fix this issue in the following commit: https://github.com/odoo-dev/odoo/commit/c4937132a38873761fa0ac0b41c983b917cb52f1 Documentation: https://github.com/d3/d3-axis#axis_tickValues closes odoo/odoo#27828
2018-10-02[FIX] web: avoid no content helper for pie chart in comparison modeAdrien Dieudonne
In comparison mode with no data, we render two empty pie charts even if it's not an embedded view. The non content helper is still used when there is no comparison.
2018-10-02[FIX] web: fix update problems in graph viewMathieu Duckerts-Antoine
The graph view was not updated correctly with respect to time range menu data. We fix that problem in this commit.
2018-10-01[FIX] web: right labels in bar chart and comparison modeMathieu Duckerts-Antoine
For a single groupby selected, the graph view didn't render well the data when simultaneously in bar chart and comparison mode. The labels were in that case always integers. This commit fixes that situation.
2018-10-01[FIX] web: line chart x ticks labels overlappAdrien Dieudonne
This commit hides some labels depending of the avalaible size of the graph. We had to skip some test because 'renderEnd' is not triggered for line chart. We need to update nv.d3.
2018-09-26[FIX] line chart: show tick labels on x axesAdrien Dieudonne
Before this commit all x axis labels were not displayed because ticksLabels was empty. Now, we show all labels except the first one and the last one because they are truncate. We need at least two intermediate labels to know the scale and the direction. So, we only remove labels when there is more than 3 data points.
2018-09-26[REF] web: design adjustments for dahboard viewsri-odoo
2018-09-26[FIX] web: menu items are now correctly sorted by alphabetical ordersvs-odoo
Menu items for measures list are now sorted by their 'string' value. We set that string in lowercase because uppercase/lowercase influences string comparison, so we are sure to compare always strings with the same case. This fix is effective for pivot view, cohord view and graph board. Task #1882576
2018-09-25[FIX] web: undefined graph when pie chart has no dataAdrien Dieudonne
Before this commit, a crash occured when the no content helper was rendered on an pie chart without data.
2018-09-25[FIX] web: display empty pie chart for embedded viewAdrien Dieudonne
Before this commit, every pie chart without any data displayed the non content helper in the middle of the screen. This behavior is intended most of the time except for embedded pie chart (such as in the dashboard views). Now, an embedded pie chart without any data is rendered and displays the error message in the middle of it. We had to render it with nv.d3 to match the size of the other graph in comparison mode. Another commit in enterprise will add a test for this fix. For the moment, embedded empty pie charts are only used on dasboard views.
2018-09-24[FIX] web: graph_renderer: show graph titleAdrien Dieudonne
Since odoo/enterprise@e3b0d2a, the title wasn't set anymore. This logic is now moved in the graph renderer to be able to set a title in every graphs. For now, we only use the title attribute for pie charts embedded in dashboard views. Additional tests has been added in 'web_dashboard' (enterprise).
2018-09-20[IMP] web: graph view: design improvementsAdrien Dieudonne
This commit improves UI of charts: - Reduce margins of svg - Put ticks label on right of y axis - Bigger lines (line chart only) - ligther area color (line chart only) - Hide y axis line - Force charts to begin at y=0 - Hide zero tick on y axes There is no test because these changes only concerns visual effects. Task ID: 1877588
2018-08-27[MERGE] forward port branch saas-11.4 up to a5187cef107Christophe Simonis
2018-08-27[MERGE] forward port branch saas-11.3 up to 9eef533e986Christophe Simonis
2018-08-27[MERGE] forward port branch 11.0 up to 3c9aa504496Christophe Simonis
2018-08-27[FIX] web: Graph: group by two fields on line chartDipalee Bhalodia
Before this commit, when we applied two or more groupbys in line graph, the groups displayed on the X axis where shifted to the left, and the first one wasn't displayed at all. related task: #1848289 Closes: #25037
2018-08-21[MERGE] forward port branch saas-11.3 up to 6cc7d3f9451Christophe Simonis
2018-08-20[FIX] web: graph_renderer: check graph data before renderingAdrien Dieudonne
Before this commit, we had two different errors when data was unavailable: The first one is generated by Odoo: "No data to display, try to[...]" The second one is generated by nvd3: "No Data Available". We always want the same message. So now, we always make some checks before rendering the graph by calling _render.
2018-08-20[FIX] web: graph_renderer: check graph data before renderingAdrien Dieudonne
Before this commit, a crash occured when you tried to load a bar chart without any data. Example in Purchase -> Reporting. Since this commit 3d2ca810, we do some data processing without checking if data exists. To fix this, we have to always makes some checks before rendering the graph by calling _render.
2018-08-14[IMP] web: comparisons in graph viewAdrien Dieudonne
A previous commit [333ac27] has introduced a new widget TimeRangeMenu that allows to create two sets of data to compare relatively to a given date or datetime field. This commit allows the graph view to render appropriately two sets of data as would be expected in the different modes. Task Id: 1835644
2018-08-10[FIX] web: Add a right margin to line chartFrancois Volral
Before, the line chart was rendered with a right margin of 0 px meaning the right border of the graph was stucked against the right border of the screen cutting out the last x-axis label. This was uggly. This commit fix that situation by adding a right margin of 80 px.
2018-08-10[IMP] web: Handle date interval in graph chartsFrancois Volral
This commit only applies for chart grouped on date or datetime fields. In that case: - Line Charts : fill missing groups and doesn't display undefined values. - Bar Charts : doesn't fill missing groups but display undefined values. - Pie Charts : doesn't fill missing groups but display undefined values. This commit is part of task #1835644
2018-08-10[IMP] web: fill area under LineChartFrancois Volral
Part of Task #1835644
2018-08-02[FIX] web: use fieldName instead of field in _sanitizeValueRomainLibert
In _sanitizeValue we can receive field as a string of the form fieldName:grouping, if we search for this directly in the fields of the model we won't find anything. Hence we should use the fieldName part of it.
2018-08-01[IMP] web: use true and false as values for boolean group byRomainLibert
In the graph view, by default the value false was considered to be a non set value (which is the case when dealing with M2O fields). But in the case of boolean fields, we want to display the value false.
2018-07-27[REF] *: BS4, adapt dropdowns and caretsqsm-odoo
- The dropdown structure was simplified, allowing to get rid of the 3-levels structure induced by <ul/> elements and dropdowns can now contain anything. The class 'dropdown-item' is now mandatory for each dropdown clickable element. The class 'dropdown-item-text' can be used to add same padding and style but without making the element have a clickable look. - Dividers now use the class 'dropdown-divider' - The way dropdowns are opened and hidden also changed (before the 'open' class was added on the `.dropdown-menu` parent, now the 'show' class is added on both the `.dropdown-menu` parent and the `.dropdown-menu` itself). - JS-wise, no click event handlers can be put on `.dropdown-toggle` elements anymore (instead, use handlers for dropdown events). - Carets are automatically put on `.dropdown-toggle` elements, so this commit replaces the `.caret` elements with this. This feature was possible to disable but would prevent us from adding a caret with scss. Also, this simplifies the DOM. The 'o-no-caret' class was also introduced to allow using the 'dropdown-toggle' class on non-caret elements. - Also adapt the scss to use $caret-width instead of $caret-width-base
2018-07-27[REF] web, *: BS4, update JS media queriesqsm-odoo
* website_quote, website_sale
2018-07-27[REF] web, *: BS4, adapt use of tooltip/popover.jsqsm-odoo
2018-07-10[IMP] web: sort measures in graph view and pivot viewRomainLibert