Forum Discussion
dhavalu
10 years agoFrequent Visitor
Hyperlink not clickable with custom visual.
Hello, I am working on creating custom visual which creats simple hyperlink using d3js. Some how when its clicked it dosent open the browser even though the link has proper href and target tags. I...
dhavalu
10 years agoFrequent Visitor
Desktop Power Bi restricts hyperlinks.
Below code works for Power Bi Web.
var val = 'https://powerbi.microsoft.com';
tr.append("td").append("a").attr("href", val).attr("title", val).attr("target", "_blank").text(val);
Make sure that url is valid http or https protocol. Without the protocol the link would try searching within subdomain of https://app.powerbi.com and the page wont get displayed.
Try this out.
Mcburn
9 years agoHelper II
I got a solution on last Friday 30. Sep 2016.
I try out window.open in the onClick method.
bars.on('click', function(d) {
selectionManager.select(d.selectionId).then((ids: ISelectionId[]) => {
bars.attr({
'fill-opacity': ids.length > 0 ? BarChart.Config.transparentOpacity : BarChart.Config.solidOpacity
});
window.top.location.href = "https://www.google.com";
//window.open("https://google.de");
d3.select(this).attr({
'fill-opacity': BarChart.Config.solidOpacity
});
});
(<Event>d3.event).stopPropagation();
});
bars.exit()
.remove();
But today i got the sandbox error in my chrome console. Did the Power BI Developer change something on the IFrame?