Bazı değerlerin 0
olduğu arka uçtan veri alıyorum. Bu değerler için daire oluşturmak istemiyorum.d3js - diziyi değerlerle filtrelemek ve verilere geçirmek nasıl?
Anladığım kadarıyla, bir filtre kullanmam gerekiyor, ancak bunu nasıl kullanacağım konusunda hiçbir fikrim yok. bir dizidir
var circles = city.selectAll("circle")
.data(function(d) {
return d.values //this is a array length 20 how to filter that? i need only with values more than 0
})
.enter()
.append("circle")
.attr("r", 3.5)
.attr("cx", function(d, i) {
return x(d.date)
})
.attr("cy", function(d) {
return y(d.temperature)
})
.style('cursor', 'pointer')
.attr("fill", "transparent")
.attr("stroke", "yellow")
.attr("stroke-width", 0);