add map and icons pkg
This commit is contained in:
@@ -17,7 +17,7 @@ class TestAnalyticsPie extends Component {
|
||||
|
||||
drawChart(data) {
|
||||
if (!data) return;
|
||||
|
||||
|
||||
var margin = { top: 60, right: 20, bottom: 30, left: 50 },
|
||||
width = 960 - margin.left - margin.right,
|
||||
height = 500 - margin.top - margin.bottom,
|
||||
@@ -56,12 +56,23 @@ class TestAnalyticsPie extends Component {
|
||||
.enter().append("g")
|
||||
.attr("class", "arc");
|
||||
|
||||
var tooltip = d3.select("#category-diagram")
|
||||
.append("div")
|
||||
.style("position", "absolute")
|
||||
.style("z-index", "10")
|
||||
.style("visibility", "hidden")
|
||||
.style("background", "#fff")
|
||||
.text("a simple tooltip");
|
||||
|
||||
arc.append("path")
|
||||
.attr("d", path)
|
||||
.attr("fill", function (d) { return color(d.data.category); });
|
||||
.attr("fill", function (d) { return color(d.data.category); })
|
||||
.on('mouseover', (event, d) => { tooltip.text(`${d.data.category} (${d.data.count})`); console.log(d.data.count); return tooltip.style("visibility", "visible"); });
|
||||
|
||||
console.log(arc)
|
||||
|
||||
|
||||
|
||||
arc.append("text")
|
||||
.attr("transform", function (d) {
|
||||
return "translate(" + label.centroid(d) + ")";
|
||||
|
||||
Reference in New Issue
Block a user