Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
Hi all,
Are there any code repo's that have a working example of a Power BI custom visual that uses the plotly.js library?
Ideally, the code should be minimal and should call plotly.js's plot() function instead of manual construction using D3. (In any case, plotly.js is built on D3.) An example of a plotly.js chart is here [1].
I could find this [2] example, but it is outdated and I could not get it to work.
Note that I am not referring to the R plotly library (which I can get to work correctly for an R custom visual). Instead, I would like to use plotly.js in a typescript custom visual. I can get the pbiviz to compile and export the visual, but when I import it into Power BI, it displays only a blank tile. The only error message that I could manage to produce is (using pbiviz start and Power BI Service):
SCRIPT5009: SCRIPT5009: 'module' is not defined
However, I am not even sure whether this message is related to Plotly.
Any hints would be appreciated.
Take a look at the post below.
https://community.powerbi.com/t5/Developer/Include-vis-js-in-custom-visual-causes-error/td-p/340881
Hi @v-chuncz-msft,
Do you suggest to create a .js file in the src with the following line?
var plotly = window.plotly || window.window.plotly;
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
9 | |
8 | |
4 | |
2 | |
2 |
User | Count |
---|---|
4 | |
3 | |
3 | |
3 | |
2 |