<!DOCTYPE html>
<
html
lang
=
"en"
>
<
head
>
<
meta
charset
=
"UTF-8"
/>
<
meta
name
=
"viewport"
path1tent="
width
=
device
-width,
initial-scale
=
1
.0" />
</
script
>
</
head
>
<
body
>
<
h2
style
=
"color:green"
>GeekforGeeks</
h2
>
<
p
>log.rangeRound() Function</
p
>
<
script
>
var log = d3.scaleLog()
// Domain
.domain([1, 10])
// Range for the domain
.rangeRound([0, 960]);
document.write("<
br
/><
div
style
=
float
:left;>");
document.write("<
p
> With rangeRound()</
p
>");
document.write("<
h3
>" + log(1.5) + "</
h3
>");
document.write("<
h3
>" + log(2.5) + "</
h3
>");
document.write("<
h3
>" + log(3.5) + "</
h3
>");
document.write("<
h3
>" + log(4.5) + "</
h3
>");
document.write("<
h3
>" + log(8.5) + "</
h3
>");
document.write(
"<
h3
>" + log(10.5) + "</
h3
></
div
>");
var log = d3.scaleLog()
// Domain
.domain([1, 10])
// Range for the domain
.range([0, 960]);
document.write(
"<
div
style
=
margin
-left:10px;float:left;>");
document.write("<
p
> Without rangeRound()</
p
>");
document.write("<
h3
>" + log(1.5) + "</
h3
>");
document.write("<
h3
>" + log(2.5) + "</
h3
>");
document.write("<
h3
>" + log(3.5) + "</
h3
>");
document.write("<
h3
>" + log(4.5) + "</
h3
>");
document.write("<
h3
>" + log(8.5) + "</
h3
>");
document.write(
"<
h3
>" + log(10.5) + "</
h3
></
div
>");
</
script
>
</
body
>
</
html
>