This is my current chart which i created using ng2-charts library. It can give me my data output as popup on mouse hover.
Instead of this i need fixed block which contain my company logo and name. I don't have any idea how to modify this html.
For getting list of companies at given stage,
callbacks: {
title: function (tooltipItems, data) {
return (tooltipItems[0] || {})['xLabel'];
},
label: function (tooltipItems, data) {
let dummyValue : any[] = [
{id:123, user: "Test Data 1", stage: "Stage 3"},
{id:456, user: "Test Data 2", stage: "Stage 3"},
{id:789, user: "Test Data 3", stage: "Stage 6"},
{id:147, user: "Test Data 4", stage: "Stage 6"}
];
let result = [];
dummyValue.forEach(element => {
if (tooltipItems.xLabel === element.stage) {
result.push(element.user);
}
});
return result;
}


You can create a custom tooltip by using the
customproperty and adding a callback function.E.g. Add
tooltipsproperty to your ng2-chartsChartOptions:You can change the
<img>tag to add in your company logo as asrcattribute in this line:var img = '<img width="20" height="20" style="background-color:pink; margin-right: 6px;" >';Here's my codepen for you to explore: Codepen link ⚡