<!DOCTYPE html>
<html>
<meta charset="utf-8">
<head>
<script src=
"https://cdnjs.cloudflare.com/ajax/libs/d3/4.2.2/d3.min.js">
</script>
</head>
<body>
<h1 style="text-align:center; color:green;">
GeeksforGeeks
</h1>
<center>
<svg id="gfg" width="200" height="200"></svg>
</center>
<script>
var data = [
{ x: 0, y: 0 },
{ x: 1, y: 3 },
{ x: 2, y: 15 },
{ x: 5, y: 15 },
{ x: 6, y: 1 },
{ x: 7, y: 5 },
{ x: 8, y: 1 }];
var xScale = d3.scaleLinear()
.domain([0, 8]).range([25, 175]);
var yScale = d3.scaleLinear()
.domain([0, 20]).range([175, 25]);
var line = d3.line()
.x((d) => xScale(d.x))
.y((d) => yScale(d.y))
.curve(d3.curveBundle.beta(.25));
var line1 = d3.line()
.x((d) => xScale(d.x))
.y((d) => yScale(d.y))
.curve(d3.curveBundle.beta(.5));
var line2 = d3.line()
.x((d) => xScale(d.x))
.y((d) => yScale(d.y))
.curve(d3.curveBundle.beta(.75));
var line3 = d3.line()
.x((d) => xScale(d.x))
.y((d) => yScale(d.y))
.curve(d3.curveBundle.beta(1));
d3.select("#gfg")
.append("path")
.attr("d", line(data))
.attr("fill", "none")
.attr("stroke", "green");
d3.select("#gfg")
.append("path")
.attr("d", line1(data))
.attr("fill", "none")
.attr("stroke", "green");
d3.select("#gfg")
.append("path")
.attr("d", line2(data))
.attr("fill", "none")
.attr("stroke", "green");
d3.select("#gfg")
.append("path")
.attr("d", line3(data))
.attr("fill", "none")
.attr("stroke", "green");
</script>
</body>
</html>