Update fee distribution graph and fix arrow.

This commit is contained in:
softsimon
2020-03-20 02:11:40 +07:00
parent 3ed0e38582
commit 55c6ef6d41
5 changed files with 59 additions and 25 deletions

View File

@@ -630,6 +630,32 @@ Chartist.plugins.tooltip = function (options: any) {
}
};
Chartist.plugins.ctPointLabels = (options) => {
return function ctPointLabels(chart) {
const defaultOptions2 = {
labelClass: 'ct-point-label',
labelOffset: {
x: 0,
y: -10
},
textAnchor: 'middle'
};
options = Chartist.extend({}, defaultOptions2, options);
if (chart instanceof Chartist.Line) {
chart.on('draw', (data) => {
if (data.type === 'point') {
data.group.elem('text', {
x: data.x + options.labelOffset.x,
y: data.y + options.labelOffset.y,
style: 'text-anchor: ' + options.textAnchor
}, options.labelClass).text(options.labelInterpolationFnc(data.value.y)); // 07.11.17 added ".y"
}
});
}
};
};
function show(element: any) {
if (!hasClass(element, 'tooltip-show')) {
element.className = element.className + ' tooltip-show';