Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
7 years ago
Solved

Custom Visual Tooltip to show the Tooltip page

Hi I am trying to add a page as tooltip for my custom visual.  My tooltip code in visual.ts is   //constructor this.MainValue = this.container .append('text') ...
  • dm-p's avatar
    dm-p
    7 years ago

    Hi Anonymous,

    if you're just using a measure, then you'd use the .withMeasure() function when creating.

    I have created a branch in my sample repo for the card, with a commit detailing all changes I made to get this to work. You should be able to check this branch out and have a look.

    The selection ID will work from the measure field; the tooltips field is not used in this case, so you may need to amend your approach as required.

    Changes should be highlighted in the commit details, but to summarise what I did:

    I created a report page with the same measure on it, e.g.:

    Added Length (mm) measure as report page tooltip filter

    I set up the tooltip page as normal, e.g.:

    Assigning tooltip page

    Going back to the data roles, I'll now see that the Tooltip Page is showing in the Tooltip role:

    So far, so good...

    And, if I hover over, I get my page, e.g.:

    Success!But... there's more! Even though this is a single measure, note that my report page has a column chart for a breakdown by category. Even though I only specify .withMeasure() in my createSelectionIdBuilder() call, the selection ID is smart enough to know that if I filter my visual by the category above (e.g. removing 0.5), then the report page will filter it out too, e.g.:Category filtering at visual level respected by report page tooltip

    Hopefully this helps you out with your challenge.

    Good luck!

    Daniel