Forum Discussion

satishr's avatar
satishr
Helper III
8 years ago
Solved

Custom visual tooltip service not working

I'm writing a custom visual with some KPIs and a bar chart. I have created the bar chart by following the below article. https://tsmatz.wordpress.com/2016/09/27/power-bi-custom-visuals-programming/ ...
  • v-viig's avatar
    v-viig
    8 years ago

    Thank you for sharing. We're going to look into the issue. 

     

    Ignat Vilesov,

    Software Engineer

     

    Microsoft Power BI Custom Visuals

    [email protected]

  • satishr's avatar
    satishr
    8 years ago

    v-viig Thanks for sharing the solution. Below were the changes done in my code.

    this.tooltipServiceWrapper.addTooltip(this.svg.selectAll('.bar'),
    (tooltipEvent: TooltipEventArgs<BarData>) => Visual.getTooltipData(tooltipEvent.data),
    (tooltipEvent: TooltipEventArgs<BarData>) => null);

    private static getTooltipData(data: BarData): VisualTooltipDataItem[] {
    return [{
    displayName: data.Date,
    value: `${data.Indicator}`,
    }];
    }