Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
ConorHG
Helper I
Helper I

Custom visual not displaying

Hi all, 

 

I am new to developing visuals so I am working my way through the powebi-visual github repo.

But I am stuck on 'Building a Visual with Static Data'. I have tried following this tutorial but it doesn't work for me. 

 

I am not having any issues with my code or receiving any errors, my visual just won't display. I have even copied the code directly from the repo and still, nothing is displaying.

I have added a hello world output to the visual and that updates straight away so I know the issue isn't the connection. 

 

Any ideas would be appreciated. 

 

Thanks, 
Conor.

 

1 ACCEPTED SOLUTION
v-viig
Community Champion
Community Champion

You must fill Fields of the stock custom visual to fix the issue with update count.

 

Ignat Vilesov,

Software Engineer

 

Microsoft Power BI Custom Visuals

pbicvsupport@microsoft.com

View solution in original post

8 REPLIES 8
v-chuncz-msft
Community Support
Community Support

@ConorHG,

 

Use try...catch statement and check the Web Console. If convenient, share us a complete project for a quick test.

Community Support Team _ Sam Zha
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Thanks @v-chuncz-msft,

 

I checked the console and got the following: 

Uncaught SyntaxError: Unexpected token export
    at Object.i [as injectJsCode] (VM1088 visualhostcore.min.js:2)
    at i.loadWithoutResourcePackage (VM1089 visualsandbox.min.js:1)
    at i.executeMessage (VM1089 visualsandbox.min.js:1)
    at i.onMessageReceived (VM1089 visualsandbox.min.js:1)
    at VM1089 visualsandbox.min.js:1
    at e.invokeHandler (VM1088 visualhostcore.min.js:3)
    at e.dispatchMessage (VM1088 visualhostcore.min.js:3)
    at e.onMessageReceived (VM1088 visualhostcore.min.js:3)
    at windowMessageHandler (VM1088 visualhostcore.min.js:3)
    at dispatch (VM1084 visualsandbox.minimal.externals.js:16777)

The line of code it's referring to is from VM1322: 

export {version} from "./build/package";

Not really sure what the issue is, tried installing different versions of d3 but no change. 

 

Thanks, 

Conor.

v-viig
Community Champion
Community Champion

What version of d3 do you use?

Please note that PBIVIZ Tools don't support d3 v4. You should use d3 v3 instead (d3 v3.5.5 works well).

 

Ignat Vilesov,

Software Engineer

 

Microsoft Power BI Custom Visuals

pbicvsupport@microsoft.com

@v-viig I was using v4.9.1 so I downgraded and that resolved that issue but I still cannot see my visual. 

 

Code: 

https://github.com/ConorHG/barchart

 

Note: According to Microsoft's git repo PowerBI Tools supports d3 v4.9.1 but clearly it doesn't.

 

Appreciate any help.

 

Thanks, 
Conor.

v-viig
Community Champion
Community Champion

I can see the visual (take a look at the screenshot below).

However, there's tiny mistake of applying class name for d3 selection. This issue can be fixed by this code:

            let bars = this.barContainer.selectAll(".bar").data(ViewModel.dataPoints);
            bars.enter()
                .append("rect")
                .classed("bar" , true);

image.png

 

Ignat Vilesov,

Software Engineer

 

Microsoft Power BI Custom Visuals

pbicvsupport@microsoft.com

Hi @v-viig

 

Thanks for your reply.

 

Fixed that issue in the code but for whatever reason, I still cannot see the visual. 

I have tried several different browsers as well and it has made no difference. 

 

Completely stumped. 

Visual.PNG

 

I added the below to the code and it displays okay.

 

Hello World.PNG

 

Thanks for your help. 

Conor.

I have also tried the stock project. 

But the update count counter doesn't change when I move or resize the visual.

v-viig
Community Champion
Community Champion

You must fill Fields of the stock custom visual to fix the issue with update count.

 

Ignat Vilesov,

Software Engineer

 

Microsoft Power BI Custom Visuals

pbicvsupport@microsoft.com

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.