I have a dataset, based on the values i want to print "Warning: joe has watched 14 cat videos today" in either black or red. if value is bigger than 10 its in red. How do i do this in using d3 or html formatting??
var dataset = [14, 5, 26, 23, 9];
d3.select("body").selectAll("p")
.data(dataset)
.enter()
.append("p")
.style('fill', 'darkOrange')
.text(function(d, i){
for (i=0; i<5; i++)
{
result = "Warning: Joe watched " + d + " cat videos today";
}
return result;
});
Need it to look like this