diff --git a/src/models/historicalBar.js b/src/models/historicalBar.js index d12585d..6105e60 100644 --- a/src/models/historicalBar.js +++ b/src/models/historicalBar.js @@ -102,7 +102,7 @@ nv.models.historicalBar = function() { var bars = wrap.select('.nv-bars').selectAll('.nv-bar') - .data(function(d) { return d }); + .data(function(d) { return d }, function(d,i) {return getX(d,i)}); bars.exit().remove(); diff --git a/src/models/historicalBarChart.js b/src/models/historicalBarChart.js index 00ca69a..f6acccb 100644 --- a/src/models/historicalBarChart.js +++ b/src/models/historicalBarChart.js @@ -85,7 +85,7 @@ nv.models.historicalBarChart = function() { - margin.top - margin.bottom; - chart.update = function() { chart(selection) }; + chart.update = function() { container.transition().call(chart) }; chart.container = this; //set state.disabled diff --git a/test/lineChartTest.html b/test/lineChartTest.html index 399c8d3..0203036 100644 --- a/test/lineChartTest.html +++ b/test/lineChartTest.html @@ -13,6 +13,7 @@ Stacked Area Cumulative Line Scatter + Real time test nv.interactiveBisect unit tests
diff --git a/test/realTimeChartTest.html b/test/realTimeChartTest.html new file mode 100644 index 0000000..d8a8029 --- /dev/null +++ b/test/realTimeChartTest.html @@ -0,0 +1,102 @@ + + + + + + + + +

Example showing real time chart updating

+ The chart below is a historical bar chart, which is ideal for visualizing time series data.
+ First, you need to update the data model for the chart. In the example, we append a random number + every half a second. Then, you call chart.update(). + +
+ + +
+ + + + + + + + + + + + + + + + + + + \ No newline at end of file