D3
OG
Old school D3 from simpler times
All examples
By author
By category
About
jwilber
Full window
Github gist
roughCharts.js logo
Built with
blockbuilder.org
<!DOCTYPE html> <head> <meta charset="utf-8"> <script src="https://d3js.org/d3.v4.min.js"></script> <style> @import url('https://fonts.googleapis.com/css?family=Gaegu'); body { margin:0;position:fixed;top:0;right:0;bottom:0;left:0; } </style> </head> <body> <script> // Feel free to change or delete any of the code you see in this editor! var svg = d3.select("body").append("svg") .attr("width", 960) .attr("height", 500) svg.append("text") .attr("y", 100) .attr("x", 120) .attr("font-size", 50) .attr("font-family", "Gaegu") .text('roughCharts.js') .style('opacity', .8) var data = ["r-o-u-g-h-C-h-a-r-t-s-.-j-s"]; var text = svg.selectAll(null) .data(data) .enter() .append("text") .attr("y", 200) .attr("x", 120) .attr("font-size", 50) .attr("font-family", "Gaegu") .text(function(d) { return d.split("-")[0] }) .append("tspan") .style("fill", "coral") .text(function(d) { return d.split("-")[1] }).append("tspan") .style("fill", "skyblue") .text(function(d) { return d.split("-")[2] }).append("tspan") .style("fill", "pink") .text(function(d) { return d.split("-")[3] }).append("tspan") .style("fill", "teal") .text(function(d) { return d.split("-")[4] }).append("tspan") .style("fill", "teal") .text(function(d) { return d.split("-")[5] }).append("tspan") .style("fill", "pink") .text(function(d) { return d.split("-")[6] }).append("tspan") .style("fill", "skyblue") .text(function(d) { return d.split("-")[7] }).append("tspan") .style("fill", "orange") .text(function(d) { return d.split("-")[8] }).append("tspan") .style("fill", "blue") .text(function(d) { return d.split("-")[9] }).append("tspan") .style("fill", "gold") .text(function(d) { return d.split("-")[10] }).append("tspan") .style("fill", "black") .text(function(d) { return d.split("-")[11] }).append("tspan") .style("fill", "tan") .text(function(d) { return d.split("-")[12] }).append("tspan") .style("fill", "tan") .text(function(d) { return d.split("-")[13] }) </script> </body>
https://d3js.org/d3.v4.min.js