Quantcast
Channel: Developer topics
Viewing all articles
Browse latest Browse all 17927

Custom Visuals- How to move text when resizing chart

$
0
0

I tried adding text to the Sample Bar Chart code

         bars.enter()
                .append("text")
                .classed("label",true) //or "label"
                .attr ("y",d => yScale(<number>d.value)+1)
                .attr ("x",d => xScale(d.category)+xScale.rangeBand()/2)
                .attr("text-anchor", "middle")
             // .attr("font-size", "10000000.5em")
                .attr("fill", "red")
                .text(d => <string>d.value)
                ;

 

The issue is this text do not move when I resize the chart


Viewing all articles
Browse latest Browse all 17927

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>