Forum Discussion
Custom Visual Tooltip to show the Tooltip page
- 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:
- Created a measureSelectionId property in my ICard interface
- Assigned the host object as a visual class property
- Added this to the view model function call signature, and updated this in the visual workflow
- Set this to null before we validate the view model
- Create a selection ID for the measure if the visual state is valid
- Add this to the third function parameter for the addTooltip call
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
Hello,
I'm facing a very similar problem.
Can you please share the repository?
I really appreciate it, thank you.
Anonymous wrote:Thanks dm-p
Thank you so much for the detailed explanation and example. I will modify my interface with selectionID too.
Anonymous wrote:Thanks dm-p
Thank you so much for the detailed explanation and example. I will modify my interface with selectionID too.
Hi Anonymous,
The repo link is in the post marked as the solution, albeit direct links to the branch and commit of interest.
The specifc repo link is here. Note that as per the links above, the example is in a branch off master named report-page-tooltip, so once you have cloned the repo you will need to check out this branch specifically to observe the changes documented above.
Good luck!
Daniel
- deepbag2 years agoNew Member
Hi,
Im using amcharts 5 with react to show report page in custom visual but
TooltipServiceWrapper is created for d3 i thinkimport { Selection } from "d3-selection";addTooltip<T>(selection: Selection<any, any, any, any>, getTooltipInfoDelegate: (datapoint: T) => VisualTooltipDataItem[], getDataPointIdentity?: (datapoint: T) => ISelectionId, reloadTooltipDataOnMouseMove?: boolean): void;
the first parameter use d3 selection
in internet also didnt get the solution about it
how can i achive this with amcharts 5 verison can you please help me to impliement report pages as tooltip