D3 line chart 2
How do I make an d3 line chart 2?
What is a d3 line chart 2? How do you make a d3 line chart 2? This script and codes were developed by Shannon Range on 10 November 2022, Thursday.
D3 line chart 2 - Script Codes HTML Codes
<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>d3 line chart 2</title> <link rel="stylesheet" href="css/style.css">
</head>
<body> <script src="https://d3js.org/d3.v3.min.js"></script> <script src='http://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js'></script> <script src="js/index.js"></script>
</body>
</html>
D3 line chart 2 - Script Codes CSS Codes
path { stroke: steelblue; stroke-width: 4; fill: none;
}
line { stroke: black;
}
path:hover { stroke:red; stroke-width:8;
}
text { font-family: Arial; font-size: 9pt;
}
D3 line chart 2 - Script Codes JS Codes
var top5 = [ 51, 50, 51, 55, 56, 58, 60, 59, 60, 63, 66, 70, 71, 71, 74, 76, 80, 86, 87, 90, 91, 92, 99, 99, 99, 97, 100, 103, 106, 107, 106, 105, 108, 110, 114, 117, 120, 122, 124, 128, 125, 122, 123, 128, 132, 133, 135, 142, 148, 154,154 ,154 ,151, 153, 152, 157, 158, 158, 154, 154, 152, 151, 151, 154], w = 600, h = 600, margin = 30, y = d3.scale.linear().domain([0, d3.max(top5)]).range([0 + margin, h - margin]), x = d3.scale.linear().domain([0, top5.length]).range([0 + margin, w - margin]) var svg = d3.select("body") .append("svg") .attr("width", w) .attr("height", h); var g = svg.append("svg:g") .attr("transform", "translate(0, 600)"); var line = d3.svg.line() .x(function(d,i) { return x(i); }) .y(function(d) { return -1 * y(d); }) g.append("svg:path").attr("d", line(top5)); g.append("svg:line") .attr("x1", x(0)) .attr("y1", -1 * y(0)) .attr("x2", x(w)) .attr("y2", -1 * y(0)) g.append("svg:line") .attr("x1", x(0)) .attr("y1", -1 * y(0)) .attr("x2", x(0)) .attr("y2", -1 * y(d3.max(top5))) g.selectAll(".xLabel") .data(x.ticks(7)) .enter().append("svg:text") .attr("class", "xLabel") .text(function(d,i){ return d + 1950}) .attr("x", function(d) { return x(d) }) .attr("y", 0) .attr("text-anchor", "middle") g.selectAll(".yLabel") .data(y.ticks(8)) .enter().append("svg:text") .attr("class", "yLabel") .text(String) .attr("x", 25) .attr("y", function(d) { return -1 * y(d) }) .attr("text-anchor", "end") .attr("dy", 4)
Developer | Shannon Range |
Username | silentkrange |
Uploaded | November 10, 2022 |
Rating | 3 |
Size | 2,196 Kb |
Views | 26,312 |
Find the perfect freelance services for your business! Fiverr's mission is to change how the world works together. Fiverr connects businesses with freelancers offering digital services in 500+ categories. Find Developer!
Name | Size |
Take Action talk bubbles with SVG | 4,528 Kb |
SVG line graph | 3,645 Kb |
Powerball Odds | 2,178 Kb |
Heartbeart sparkline animated d3 | 2,131 Kb |
Animated line graph with HighCharts | 2,113 Kb |
Count up with commas | 4,999 Kb |
D3 Productivity-Wage Gap bar chart | 3,647 Kb |
Animated bar charts in sequence | 2,195 Kb |
Dropdown menu with image change on hover | 2,747 Kb |
Info card jquery slideToggle | 2,168 Kb |
Jasper is the AI Content Generator that helps you and your team break through creative blocks to create amazing, original content 10X faster. Discover all the ways the Jasper AI Content Platform can help streamline your creative workflows. Start For Free!
Name | Username | Size |
Mondrian | Chrisarmstrong | 2,787 Kb |
Particle Motion trajectories | Sniejadlik | 5,899 Kb |
Bootstrap 3 Price Table | Honglio | 2,655 Kb |
A Pen by Patrick Cox | Pcridesagain | 2,899 Kb |
Svg penguin | _massimo | 2,990 Kb |
Cool Page Split Effect | Anthonyadamski | 6,128 Kb |
LDE old privacy page | Jasonangle | 2,339 Kb |
Welcome | Nakome | 6,076 Kb |
A Pen by Shidhin | Shidhincr | 5,015 Kb |
Mega menu | DimaZubkov | 5,066 Kb |
Surf anonymously, prevent hackers from acquiring your IP address, send anonymous email, and encrypt your Internet connection. High speed, ultra secure, and easy to use. Instant setup. Hide Your IP Now!