fixed an issue with legend placement

master
Tyler Wolf 11 years ago
commit 6752bf5cc8

@ -212,12 +212,30 @@ nv.addGraph(function() {
d3.select('#chart1')
.datum(histcatexplong)
.transition().duration(0)
.call(chart);
.transition().duration(1000)
.call(chart)
// .transition().duration(0)
.each('start', function() {
setTimeout(function() {
d3.selectAll('#chart1 *').each(function() {
console.log('start',this.__transition__, this)
// while(this.__transition__)
if(this.__transition__)
this.__transition__.duration = 1;
})
}, 0)
})
// .each('end', function() {
// d3.selectAll('#chart1 *').each(function() {
// console.log('end', this.__transition__, this)
// // while(this.__transition__)
// if(this.__transition__)
// this.__transition__.duration = 1;
// })});
nv.utils.windowResize(chart.update);
chart.dispatch.on('stateChange', function(e) { nv.log('New State:', JSON.stringify(e)); });
// chart.dispatch.on('stateChange', function(e) { nv.log('New State:', JSON.stringify(e)); });
return chart;
});
@ -238,6 +256,7 @@ nv.addGraph(function() {
d3.select('#chart2')
.datum(histcatexpshort)
.transition()
.call(chart);
nv.utils.windowResize(chart.update);

3588
nv.d3.js

File diff suppressed because it is too large Load Diff

1
nv.d3.min.css vendored

File diff suppressed because one or more lines are too long

14
nv.d3.min.js vendored

File diff suppressed because one or more lines are too long

@ -240,7 +240,13 @@ nv.models.cumulativeLineChart = function() {
{ key: 'Re-scale y-axis', disabled: !rescaleY }
];
controls.width(140).color(['#444', '#444', '#444']);
controls
.width(140)
.color(['#444', '#444', '#444'])
.rightAlign(false)
.margin({top: 5, right: 0, bottom: 5, left: 20})
;
g.select('.nv-controlsWrap')
.datum(controlsData)
.attr('transform', 'translate(0,' + (-margin.top) +')')

@ -109,7 +109,9 @@ nv.models.legend = function() {
var legendText = d3.select(this).select('text');
var nodeTextLength;
try {
nodeTextLength = legendText.node().getComputedTextLength();
nodeTextLength = legendText.getComputedTextLength();
// If the legendText is display:none'd (nodeTextLength == 0), simulate an error so we approximate, instead
if(nodeTextLength <= 0) throw Error();
}
catch(e) {
nodeTextLength = nv.utils.calcApproxTextWidth(legendText);

Loading…
Cancel
Save