Forum Discussion
Include vis.js in custom visual causes error
Hi,
I created an empty custom visualization and added vis.js but as soon as I add the line
console.log(vis);
The visualization does not work. The vis objects causes an error.
Created project and added vis.js
- pbiviz new visualizationWithVis
- npm install vis --save
- npm install @types/vis --save
tsconfig.json:
Please follow these steps to make vis.js working:
- Create a new JS file in src folder
- Put the folllowing code in the new JS file
var vis = window.vis || window.window.vis;
Include the new file into externalJs property of pbiviz.json right after node_modules/vis/dist/vis.js.
Ignat Vilesov,
Software Engineer
Microsoft Power BI Custom Visuals
7 Replies
- v-viigCommunity Champion
Looks like vis doesn't exist in the root scope.
Could you please share vis.min.js or entire project for futher debugging?
Ignat Vilesov,
Software Engineer
Microsoft Power BI Custom Visuals
- AMsDeveloperFrequent Visitor
Hello Ignat,
please find below the project in a zip file (I created it with npm, pbiviz new ... ).
Thank you for you support.
Kind regards
Thomas
Edit:
The first Screenshot is from Chrome
The last two are from Internet Explorer (dev tools looks different)
Project:
https://1drv.ms/f/s!AvUXU0wyp-zVoBOkkbzo42Sv8YbG
- v-chuncz-msftCommunity Support
- AnonymousNot applicable
I want to call the nivo react chart library in the powerbi react visual. I also have seen the documentation. there, they said, you can't call the external js file in the powerbi api 3.0. or above. Any of the way to use react chart library with the latest powerbi library. Thanks