fixed FF getBBox() issue (UI-19), extended line chart right margin +3px
This commit is contained in:
parent
0de0ea9ab6
commit
68e8121721
18
nv.d3.js
18
nv.d3.js
@ -583,10 +583,17 @@ nv.models.axis = function() {
|
||||
var maxMinRange = [];
|
||||
wrap.selectAll('g.nv-axisMaxMin')
|
||||
.each(function(d,i) {
|
||||
if (i) // i== 1, max position
|
||||
maxMinRange.push(scale(d) - this.getBBox().width - 4) //assuming the max and min labels are as wide as the next tick (with an extra 4 pixels just in case)
|
||||
else // i==0, min position
|
||||
maxMinRange.push(scale(d) + this.getBBox().width + 4)
|
||||
try {
|
||||
if (i) // i== 1, max position
|
||||
maxMinRange.push(scale(d) - this.getBBox().width - 4) //assuming the max and min labels are as wide as the next tick (with an extra 4 pixels just in case)
|
||||
else // i==0, min position
|
||||
maxMinRange.push(scale(d) + this.getBBox().width + 4)
|
||||
}catch (err) {
|
||||
if (i) // i== 1, max position
|
||||
maxMinRange.push(scale(d) - 4) //assuming the max and min labels are as wide as the next tick (with an extra 4 pixels just in case)
|
||||
else // i==0, min position
|
||||
maxMinRange.push(scale(d) + 4)
|
||||
}
|
||||
});
|
||||
g.selectAll('g') // the g's wrapping each tick
|
||||
.each(function(d,i) {
|
||||
@ -3632,7 +3639,8 @@ nv.models.lineChart = function() {
|
||||
, legend = nv.models.legend()
|
||||
;
|
||||
|
||||
var margin = {top: 30, right: 20, bottom: 50, left: 60}
|
||||
//set margin.right to 23 to fit dates on the x-axis within the chart
|
||||
var margin = {top: 30, right: 23, bottom: 50, left: 60}
|
||||
, color = nv.utils.defaultColor()
|
||||
, width = null
|
||||
, height = null
|
||||
|
10
nv.d3.min.js
vendored
10
nv.d3.min.js
vendored
File diff suppressed because one or more lines are too long
@ -263,10 +263,17 @@ nv.models.axis = function() {
|
||||
var maxMinRange = [];
|
||||
wrap.selectAll('g.nv-axisMaxMin')
|
||||
.each(function(d,i) {
|
||||
if (i) // i== 1, max position
|
||||
maxMinRange.push(scale(d) - this.getBBox().width - 4) //assuming the max and min labels are as wide as the next tick (with an extra 4 pixels just in case)
|
||||
else // i==0, min position
|
||||
maxMinRange.push(scale(d) + this.getBBox().width + 4)
|
||||
try {
|
||||
if (i) // i== 1, max position
|
||||
maxMinRange.push(scale(d) - this.getBBox().width - 4) //assuming the max and min labels are as wide as the next tick (with an extra 4 pixels just in case)
|
||||
else // i==0, min position
|
||||
maxMinRange.push(scale(d) + this.getBBox().width + 4)
|
||||
}catch (err) {
|
||||
if (i) // i== 1, max position
|
||||
maxMinRange.push(scale(d) - 4) //assuming the max and min labels are as wide as the next tick (with an extra 4 pixels just in case)
|
||||
else // i==0, min position
|
||||
maxMinRange.push(scale(d) + 4)
|
||||
}
|
||||
});
|
||||
g.selectAll('g') // the g's wrapping each tick
|
||||
.each(function(d,i) {
|
||||
|
@ -11,7 +11,8 @@ nv.models.lineChart = function() {
|
||||
, legend = nv.models.legend()
|
||||
;
|
||||
|
||||
var margin = {top: 30, right: 20, bottom: 50, left: 60}
|
||||
//set margin.right to 23 to fit dates on the x-axis within the chart
|
||||
var margin = {top: 30, right: 23, bottom: 50, left: 60}
|
||||
, color = nv.utils.defaultColor()
|
||||
, width = null
|
||||
, height = null
|
||||
|
Loading…
Reference in New Issue
Block a user