sunburst chart - tooltip formatting

This commit is contained in:
Matthias Hochsteger 2020-10-14 11:39:56 +02:00
parent 14e6a1d24b
commit 6544fbeca6

View File

@ -942,6 +942,7 @@ namespace ngcore
.data(data)
.size('size')
.color(d => color(d.name))
.tooltipTitle((d, node) => { return node.parent ? node.parent.data.name + " → " + d.name : d.name; })
.tooltipContent((d, node) => {
return `Time: <i>${getTime(d.time)}</i> <br>`
+ `calls: <i>${d.calls}</i> <br>`
@ -950,6 +951,12 @@ namespace ngcore
+ `avg: <i>${getTime(d.avg)}</i>`
})
(document.getElementById('chart'));
// Line breaks in tooltip
var all = document.getElementsByClassName('sunbirst-tooltip');
for (var i = 0; i < all.length; i++) {
all[i].white_space = "";
}
</script>
</body>
)CODE_" << std::endl;