Forum Discussion
ats1958
8 years agoHelper II
Adding ToolTips with Table DataBinding
I've created a custom visual (combination scatter plot and dual-line graph) and am attempting to add tooltips. I used table databinding and followed an example I found here for assigning an Identity....
- 8 years ago
It seems the issue is related to sending numbers as values to Tooltip API but numbers are not supported and numbers must be converted to string explicitly.
Please use this code snippet in the code:
viewModel.rangePenData.push({ grade: <number>view1.rows[i][1], rangePen: <number>view1.rows[i][3], employeeID: <string>view1.rows[i][0], identity: this.getSelectionIds(view2, this.host), tooltips: [{ displayName: "Employee ID:", value: `${view1.rows[i][0]}` }, { displayName: "Range Penetration:", value: `${view1.rows[i][3]}` } ] });Ignat Vilesov,
Software Engineer
Microsoft Power BI Custom Visuals
v-viig
8 years agoCommunity Champion
It seems the issue is related to sending numbers as values to Tooltip API but numbers are not supported and numbers must be converted to string explicitly.
Please use this code snippet in the code:
viewModel.rangePenData.push({
grade: <number>view1.rows[i][1],
rangePen: <number>view1.rows[i][3],
employeeID: <string>view1.rows[i][0],
identity: this.getSelectionIds(view2, this.host),
tooltips: [{
displayName: "Employee ID:",
value: `${view1.rows[i][0]}`
},
{
displayName: "Range Penetration:",
value: `${view1.rows[i][3]}`
}
]
});
Ignat Vilesov,
Software Engineer
Microsoft Power BI Custom Visuals