简体   繁体   中英

special characters using d3js

I want to display some data about soil moisture on a webpage. To implement this i displayed the data using d3.js. But how is it possible to display the ° character?

                    var text2 = svgContainer.selectAll("text2")
                        .data(data[0].Temperatur)
                        .enter()
                        .append("text");

                    var text2Labels = text2
                        .attr("x", "75%")
                        .attr("y", 475)
                        .attr("font-family", "Open Sans, sans-serif")
                        .attr("font-size", 70)
                        .attr("fill", "green")
                        .text(data[0].Temperatur + " alert(unescape("%B0C%0A"))");
.text(data[0].Temperatur + " \u00B0");

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM