0
Ich habe eine Liste im Formataus einer Liste
+---------+------------------+
| Country | GDP |
+---------+------------------+
| Austria | 26171.6909118266 |
+---------+------------------+
| Belgium | 24512.4131357791 |
+---------+------------------+
| Denmark | 32400.0606104087 |
+---------+------------------+
| Spain | |
+---------+------------------+
Get Daten aus Liste:
function parseData(d) {
var keys = _.keys(d[0]);
return _.map(d, function(d) {
var o = {};
_.each(keys, function(k) {
if(k == 'Country')
o[k] = d[k];
else
o[k] = parseFloat(d[k]);
});
return o;
});
}
var xAxisOptions = ["GDP"]
var data = parseData(data);
d3.select('#x-axis-menu')
.selectAll('li')
.data(xAxisOptions)
.enter()
.append('li')
.text(function(d) {return d;})
.classed('selected', function(d) {
return d === xAxis;
})
.on('click', function(d) {
xAxis = d;
updateChart();
updateMenus();
});
Das Problem ist, dass die ganze Zeit die gesamte Liste auswählen. Ich möchte alle BIPs bis Dänemark auswählen, hat jemand eine Idee?
Haben Sie bei Dänemark beenden möchten oder Sie alle leere Werte entfernen – Rajesh