[FIX] web,account,website_links: update nvd3 to last version

This commit was necessary to fix weird problems in 9.0-nightly.
Phantomjs and the old nvd3 implementations did not play well together.

* transitionDuration() replaced by duration()
* tooltips() & tooltipContent replaced by tooltip.enable and tooltip.contentGenerator
* remove useless less for tooltip

Thanks to mge for his help
This commit is contained in:
Géry Debongnie
2015-10-29 22:15:44 +01:00
parent 55535a6f61
commit 329552b78e
8 changed files with 18104 additions and 18341 deletions
@@ -27,10 +27,6 @@ var JournalDashboardGraph = kanban_widgets.AbstractField.extend({
margin: {'left': 0, 'right': 0, 'top': 0, 'bottom': 0},
showYAxis: false,
showLegend: false,
tooltips: true,
tooltipContent: function(key, x, y, e, graph) {
return self.create_tooltip(x, y, e);
},
});
self.chart.xAxis
.tickFormat(function(d) {
@@ -55,11 +51,7 @@ var JournalDashboardGraph = kanban_widgets.AbstractField.extend({
.y(function(d) { return d.value })
.showValues(false)
.showYAxis(false)
.margin({'left': 0, 'right': 0, 'top': 0, 'bottom': 40})
.tooltips(true)
.tooltipContent(function(key, x, y, e, graph) {
return self.create_tooltip(x, y, e);
});
.margin({'left': 0, 'right': 0, 'top': 0, 'bottom': 40});
self.chart.xAxis.axisLabel(self.data[0].title);
self.chart.yAxis.tickFormat(d3.format(',.2f'));
@@ -94,23 +86,6 @@ var JournalDashboardGraph = kanban_widgets.AbstractField.extend({
}
},
create_tooltip: function(x, y, e){
var header = _.findWhere(e.series.values, {x: x})
header = header && header.name || x;
var $tooltip = $('<div>').addClass('o_tooltip');
$('<b>')
.addClass('o_tooltip_title')
.html(header)
.appendTo($tooltip)
$('<div>')
.addClass('o_tooltip_content')
.html('Balance ' + y)
.appendTo($tooltip)
return $tooltip[0].outerHTML;
},
destroy: function(){
nv.utils.offWindowResize(this.on_resize);
this._super();
@@ -37,14 +37,6 @@
.o_kanban_graph_section {
.o-position-absolute(auto, 0, 0, 0);
.nvtooltip {
padding: 0 8px;
.o_tooltip_content {
color: @odoo-brand-primary;
font-weight: bold;
}
}
.o_graph_linechart {
> svg {
height: 75px;
+4854 -3787
View File
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
@@ -780,7 +780,7 @@ var FieldBarChart = common.AbstractField.extend({
.margin({top: 0, right: 0, bottom: 0, left: 0})
.tooltips(false)
.showValues(false)
.transitionDuration(350)
.transition(350)
.showXAxis(false)
.showYAxis(false);
@@ -158,7 +158,7 @@ return Widget.extend({
var chart = nv.models.multiBarChart();
chart.options({
delay: 250,
transitionDuration: 10,
transition: 10,
showLegend: true,
showXAxis: true,
showYAxis: true,
@@ -212,7 +212,7 @@ return Widget.extend({
var chart = nv.models.pieChart();
chart.options({
delay: 250,
transitionDuration: 100,
transition: 100,
color: d3.scale.category10().range(),
});
@@ -60,7 +60,7 @@ if(!$('.o_website_links_chart').length) {
.x(function(d) { return getDate(d); })
.y(function(d) { return getNbClicks(d); })
.tooltips(true)
.transitionDuration(0)
.transition(0)
.showYAxis(true)
.showXAxis(true);