<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Tooltips not working in Custom Visuals Development Discussion</title>
    <link>https://community.fabric.microsoft.com/t5/Custom-Visuals-Development/Tooltips-not-working/m-p/2202331#M4070</link>
    <description>&lt;P&gt;Dear PBI Community,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;at the moment, we are facing a problem with the PBI Tooltips.&lt;/P&gt;&lt;P&gt;We followed these instructions, but cant get them to work: &lt;A href="https://docs.microsoft.com/en-us/power-bi/developer/visuals/utils-tooltip" target="_blank"&gt;https://docs.microsoft.com/en-us/power-bi/developer/visuals/utils-tooltip&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Am I wrong, or are there some inconsistencies with the example code?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is our not working try on the instruction:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;import "./../style/visual.less";

import powerbiVisualsApi from "powerbi-visuals-api";
import "regenerator-runtime/runtime";
import powerbi = powerbiVisualsApi;

type Selection&amp;lt;T1, T2 = T1&amp;gt; = d3.Selection&amp;lt;any, T1, any, T2&amp;gt;;

import IVisual = powerbi.extensibility.IVisual;
import IVisualHost = powerbi.extensibility.visual.IVisualHost;
import VisualUpdateOptions = powerbi.extensibility.visual.VisualUpdateOptions;
import VisualConstructorOptions = powerbi.extensibility.visual.VisualConstructorOptions;

import {createTooltipServiceWrapper, ITooltipServiceWrapper, TooltipEventArgs, TooltipEnabledDataPoint  } from "powerbi-visuals-utils-tooltiputils";


import * as d3 from "d3";


export class Visual implements IVisual {
    private tooltipServiceWrapper: ITooltipServiceWrapper;


    private host: IVisualHost;
    private svg: Selection&amp;lt;any&amp;gt;;

    
    constructor(options: VisualConstructorOptions) {

        this.host = options.host;
        this.svg = d3.select(options.element)
                .append('svg');
    }

    public update(options: VisualUpdateOptions) {
        
        this.svg.attr("width", options.viewport.width);

        this.svg.attr("height", options.viewport.height);

        this.svg
            .append("rect")
            .attr("fill", "green")
            .attr("width", "150")
            .attr("height", "150")
            .attr("x", 100)
            .attr("y", 100)
            .classed("visual", true)
            .data([{
                tooltipInfo: [{
                    displayName: "Power BI",
                    value: 2016
                }]
            }]);

        

        this.tooltipServiceWrapper = createTooltipServiceWrapper(this.host.tooltipService, this.svg.node() as Element); // tooltipService is from the IVisualHost.

        this.tooltipServiceWrapper.addTooltip(
            this.svg,
            (tooltipEvent: TooltipEventArgs&amp;lt;TooltipEnabledDataPoint&amp;gt;) =&amp;gt; {
                return tooltipEvent.data.tooltipInfo;
            });
    }
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Where is the problem with this code?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 22 Nov 2021 20:59:48 GMT</pubDate>
    <dc:creator>PMAnalytics</dc:creator>
    <dc:date>2021-11-22T20:59:48Z</dc:date>
    <item>
      <title>Tooltips not working</title>
      <link>https://community.fabric.microsoft.com/t5/Custom-Visuals-Development/Tooltips-not-working/m-p/2202331#M4070</link>
      <description>&lt;P&gt;Dear PBI Community,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;at the moment, we are facing a problem with the PBI Tooltips.&lt;/P&gt;&lt;P&gt;We followed these instructions, but cant get them to work: &lt;A href="https://docs.microsoft.com/en-us/power-bi/developer/visuals/utils-tooltip" target="_blank"&gt;https://docs.microsoft.com/en-us/power-bi/developer/visuals/utils-tooltip&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Am I wrong, or are there some inconsistencies with the example code?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is our not working try on the instruction:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;import "./../style/visual.less";

import powerbiVisualsApi from "powerbi-visuals-api";
import "regenerator-runtime/runtime";
import powerbi = powerbiVisualsApi;

type Selection&amp;lt;T1, T2 = T1&amp;gt; = d3.Selection&amp;lt;any, T1, any, T2&amp;gt;;

import IVisual = powerbi.extensibility.IVisual;
import IVisualHost = powerbi.extensibility.visual.IVisualHost;
import VisualUpdateOptions = powerbi.extensibility.visual.VisualUpdateOptions;
import VisualConstructorOptions = powerbi.extensibility.visual.VisualConstructorOptions;

import {createTooltipServiceWrapper, ITooltipServiceWrapper, TooltipEventArgs, TooltipEnabledDataPoint  } from "powerbi-visuals-utils-tooltiputils";


import * as d3 from "d3";


export class Visual implements IVisual {
    private tooltipServiceWrapper: ITooltipServiceWrapper;


    private host: IVisualHost;
    private svg: Selection&amp;lt;any&amp;gt;;

    
    constructor(options: VisualConstructorOptions) {

        this.host = options.host;
        this.svg = d3.select(options.element)
                .append('svg');
    }

    public update(options: VisualUpdateOptions) {
        
        this.svg.attr("width", options.viewport.width);

        this.svg.attr("height", options.viewport.height);

        this.svg
            .append("rect")
            .attr("fill", "green")
            .attr("width", "150")
            .attr("height", "150")
            .attr("x", 100)
            .attr("y", 100)
            .classed("visual", true)
            .data([{
                tooltipInfo: [{
                    displayName: "Power BI",
                    value: 2016
                }]
            }]);

        

        this.tooltipServiceWrapper = createTooltipServiceWrapper(this.host.tooltipService, this.svg.node() as Element); // tooltipService is from the IVisualHost.

        this.tooltipServiceWrapper.addTooltip(
            this.svg,
            (tooltipEvent: TooltipEventArgs&amp;lt;TooltipEnabledDataPoint&amp;gt;) =&amp;gt; {
                return tooltipEvent.data.tooltipInfo;
            });
    }
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Where is the problem with this code?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 22 Nov 2021 20:59:48 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Custom-Visuals-Development/Tooltips-not-working/m-p/2202331#M4070</guid>
      <dc:creator>PMAnalytics</dc:creator>
      <dc:date>2021-11-22T20:59:48Z</dc:date>
    </item>
  </channel>
</rss>

