[FIX] web: y-axis width in graph view

Simplifies the left margin calculation logic with a pre-defined width.
In practice, more use cases should be taken into account, and that could
just make the logic overkill.

opw-697626
This commit is contained in:
Nicolas Martinelli
2016-12-22 16:14:34 +01:00
parent 4a515a0415
commit bb2a948216
@@ -167,9 +167,8 @@ return Widget.extend({
svg.transition().duration(0);
var chart = nv.models.multiBarChart();
var maxVal = _.max(values, function(v) {return v.y})
chart.options({
margin: {left: 12 * String(maxVal && maxVal.y || 10000000).length, bottom: 60},
margin: {left: 120, bottom: 60},
delay: 250,
transition: 10,
showLegend: _.size(data) <= MAX_LEGEND_LENGTH,
@@ -308,9 +307,8 @@ return Widget.extend({
svg.transition().duration(0);
var chart = nv.models.lineChart();
var maxVal = _.max(values, function(v) {return v.y})
chart.options({
margin: {left: 12 * String(maxVal && maxVal.y || 10000000).length, right: 50},
margin: {left: 120, bottom: 60},
useInteractiveGuideline: true,
showLegend: _.size(data) <= MAX_LEGEND_LENGTH,
showXAxis: true,