minor updates for consistency throughout new Chart Models

master-patched
Bob Monteverde 12 years ago
parent dc337a37ac
commit 5f03bd8232

@ -108,11 +108,7 @@ nv.addGraph(function() {
.transition().duration(500)
.call(chart);
nv.utils.windowResize(function() {
d3.select('#chart1 svg')
.transition().duration(0)
.call(chart);
});
nv.utils.windowResize(chart.update);
return chart;
});

@ -65,7 +65,8 @@ nv.addGraph(function() {
.call(chart);
//TODO: Figure out a good way to do this automatically
nv.utils.windowResize(function() { d3.select('#chart1 svg').call(chart) });
nv.utils.windowResize(chart.update);
//nv.utils.windowResize(function() { d3.select('#chart1 svg').call(chart) });
return chart;
});

@ -136,32 +136,26 @@ long_short_data = [
nv.addGraph({
generate: function() {
var chart = nv.models.multiBarHorizontalChart()
.x(function(d) { return d.label })
.y(function(d) { return d.value })
.margin({top: 30, right: 20, bottom: 50, left: 160})
.showValues(true)
.tooltips(false)
.showControls(false);
chart.yAxis
.tickFormat(d3.format(',.2f'));
d3.select('#chart1 svg')
.datum(long_short_data)
.transition().duration(500)
.call(chart);
nv.utils.windowResize(function() {
d3.select('#chart1 svg')
.transition().duration(0)
.call(chart);
});
return chart;
}
nv.addGraph(function() {
var chart = nv.models.multiBarHorizontalChart()
.x(function(d) { return d.label })
.y(function(d) { return d.value })
.margin({top: 30, right: 20, bottom: 50, left: 160})
.showValues(true)
.tooltips(false)
.showControls(false);
chart.yAxis
.tickFormat(d3.format(',.2f'));
d3.select('#chart1 svg')
.datum(long_short_data)
.transition().duration(500)
.call(chart);
nv.utils.windowResize(chart.update);
return chart;
});

@ -179,11 +179,13 @@ svg .title {
*/
.nvd3 .multibar .groups rect,
.nvd3 .multibarHorizontal .groups rect,
.nvd3 .discretebar .groups rect {
stroke-opacity: 0;
}
.nvd3 .multibar .groups rect:hover,
.nvd3 .multibarHorizontal .groups rect:hover,
.nvd3 .discretebar .groups rect:hover {
fill-opacity: 1;
}

@ -120,6 +120,12 @@ nv.models.discreteBarChart = function() {
});
if (tooltips) dispatch.on('tooltipHide', nv.tooltip.cleanup);
//TODO: decide if this makes sense to add into all the models for ease of updating (updating without needing the selection)
chart.update = function() {
selection.transition().call(chart);
}
});
return chart;

@ -185,6 +185,12 @@ nv.models.multiBarHorizontalChart = function() {
});
if (tooltips) dispatch.on('tooltipHide', nv.tooltip.cleanup);
//TODO: decide if this makes sense to add into all the models for ease of updating (updating without needing the selection)
chart.update = function() {
selection.transition().call(chart);
}
});
return chart;

Loading…
Cancel
Save