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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

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
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.