[FIX] web,survey: update graphs tooltip to new nvd3
with the update of nvd3/d3, the tooltip api was changed. This commit updates the 3 last places where we were using the tooltips.
This commit is contained in:
@@ -50,12 +50,14 @@ if(!$('.js_surveyresult').length) {
|
||||
|
||||
//initialize discreteBar Chart
|
||||
function init_bar_chart(){
|
||||
return nv.models.discreteBarChart()
|
||||
var chart = nv.models.discreteBarChart()
|
||||
.x(function(d) { return d.text; })
|
||||
.y(function(d) { return d.count; })
|
||||
.staggerLabels(true)
|
||||
.tooltips(false)
|
||||
.showValues(true);
|
||||
|
||||
chart.tooltip.enabled(false);
|
||||
return chart;
|
||||
}
|
||||
|
||||
//initialize Pie Chart
|
||||
|
||||
@@ -738,9 +738,10 @@ var FieldPercentPie = common.AbstractField.extend({
|
||||
.donut(true)
|
||||
.showLegend(false)
|
||||
.showLabels(false)
|
||||
.tooltips(false)
|
||||
.color(['#7C7BAD','#DDD'])
|
||||
.donutRatio(0.62);
|
||||
|
||||
chart.tooltip.enabled(false);
|
||||
|
||||
d3.select(svg)
|
||||
.datum([{'x': 'value', 'y': value}, {'x': 'complement', 'y': 100 - value}])
|
||||
@@ -778,12 +779,13 @@ var FieldBarChart = common.AbstractField.extend({
|
||||
.width(width)
|
||||
.height(height)
|
||||
.margin({top: 0, right: 0, bottom: 0, left: 0})
|
||||
.tooltips(false)
|
||||
.showValues(false)
|
||||
.transition(350)
|
||||
.showXAxis(false)
|
||||
.showYAxis(false);
|
||||
|
||||
|
||||
chart.tooltip.enabled(false);
|
||||
|
||||
d3.select(svg)
|
||||
.datum([{key: 'values', values: value}])
|
||||
.transition()
|
||||
|
||||
Reference in New Issue
Block a user