getting more text lables on graph bar in d3js

11 views
Skip to first unread message

Somepalli

unread,
Aug 29, 2017, 3:19:47 AM8/29/17
to d3-js
Hi i am getting graph as above attcahment. But i want only max value of bar in d3 js

pls help...

state.selectAll("rect.text")
  .data(function (d) {
      return d.ages;
                })
.enter().append("text")
  .attr("class", "rect")
  .attr("fill","blue")
  .attr("text-anchor", "left")
  .attr("x", function(d) { return x1(d.name); })
  .attr("y", function(d) { return y(d.value); })
  .text(function(d) {
          
      if((height -y(d.value))>0){
           return ((d.value)/1000).toFixed(0);}   
                  else { return "";};
   });
1503922708232.png
1503981675034.svg
Reply all
Reply to author
Forward
0 new messages