Added fee distribution Pie Chart to the block inspector.

This commit is contained in:
Simon Lindh
2019-08-18 17:22:16 +03:00
parent dabbe402ac
commit 781051e6fa
9 changed files with 169 additions and 119 deletions

View File

@@ -496,9 +496,9 @@ Chartist.plugins.tooltip = function (options: any) {
return function tooltip(chart: any) {
let tooltipSelector = options.pointClass;
if (chart.constructor.name === Chartist.Bar.prototype.constructor.name) {
if (chart instanceof Chartist.Bar) {
tooltipSelector = 'ct-bar';
} else if (chart.constructor.name === Chartist.Pie.prototype.constructor.name) {
} else if (chart instanceof Chartist.Pie) {
// Added support for donut graph
if (chart.options.donut) {
tooltipSelector = 'ct-slice-donut';
@@ -542,7 +542,7 @@ Chartist.plugins.tooltip = function (options: any) {
let value = $point.getAttribute('ct:value');
if (options.transformTooltipTextFnc && typeof options.transformTooltipTextFnc === 'function') {
value = options.transformTooltipTextFnc(value);
value = options.transformTooltipTextFnc(value, $point.parentNode.getAttribute('class'));
}
if (options.tooltipFnc && typeof options.tooltipFnc === 'function') {