This commit is contained in:
prisar
2023-07-07 04:51:55 +05:30
parent ba5ef28a2f
commit 7644bd9046
8 changed files with 141 additions and 37 deletions

View File

@@ -37,7 +37,15 @@ class RegistraionChart extends Component {
const data =
[
{
"type": "Registration",
"gender": "Male",
"count": 50,
},
{
"gender": "Female",
"count": 70,
},
{
"gender": "Not Specified",
"count": 60,
}
];
@@ -51,7 +59,7 @@ class RegistraionChart extends Component {
.enter()
.append("div").attr("class", "line");
d3.selectAll("div.line").append("div")
.attr("class", "label").text(function (d) { return d.type });
.attr("class", "label").text(function (d) { return d.gender });
d3.selectAll("div.line").append("div")
.attr("class", "bar")
.style("width", function (d) { return d.count + "px" }).text(function (d) { return Math.round(d.count) });