почему одна диаграмма не фильтрует другую в dc.js?
Я не могу понять, как график группы постоянного тока. Так что изменение в одном фильтре отражается на всех остальных. У меня есть простой код с двумя сериями диаграмм. Когда я рисую кисть на одной, она не фильтрует другую. Не уверен почему? Может кто-нибудь, пожалуйста, взгляните на небольшой код и предложите.
d3.csv("data/compareData.txt", function(data) {
ndx = crossfilter(data);
runDimension = ndx.dimension(function(d) {return [+d3.time.format.iso.parse(d.timestamp), +d.meterid]; });
frequencyGroup = runDimension.group().reduceSum(function(d) { return +d.frequency; });
magnitudeGroup = runDimension.group().reduceSum(function(d) { return +d.magnitude; });
frequencyChart
.width(768)
.height(480)
.chart(function(c) { return dc.lineChart(c).interpolate('basis'); })
.x(d3.time.scale().domain([1366621166000, 1366621179983]))
.y(d3.scale.linear().domain([90, 100]))
.brushOn(true)
.yAxisLabel("Measured Speed km/s")
.xAxisLabel("Run")
.elasticY(true)
.dimension(runDimension)
.group(frequencyGroup)
.mouseZoomable(false)
.seriesAccessor(function(d) {return +d.key[1];})
.keyAccessor(function(d) {return +d.key[0];})
.valueAccessor(function(d) {return +d.value;})
.legend(dc.legend().x(350).y(350).itemHeight(13).gap(5).horizontal(1).legendWidth(140).itemWidth(70));
frequencyChart.yAxis().tickFormat(function(d) {return d3.format(',d')(d);});
frequencyChart.margins().left += 40;
magnitudeChart
.width(768)
.height(480)
.chart(function(c) { return dc.lineChart(c).interpolate('basis'); })
.x(d3.time.scale().domain([1366621166000, 1366621179983]))
.y(d3.scale.linear().domain([90, 100]))
.brushOn(true)
.yAxisLabel("Measured Speed km/s")
.xAxisLabel("Run")
.elasticY(true)
.dimension(runDimension)
.group(magnitudeGroup)
.mouseZoomable(false)
.seriesAccessor(function(d) {return +d.key[1];})
.keyAccessor(function(d) {return +d.key[0];})
.valueAccessor(function(d) {return +d.value;})
.legend(dc.legend().x(350).y(350).itemHeight(13).gap(5).horizontal(1).legendWidth(140).itemWidth(70));
magnitudeChart.yAxis().tickFormat(function(d) {return d3.format(',d')(d);});
magnitudeChart.margins().left += 40;
dc.renderAll();
});