javascript
8 TopicsHow to Edit and Save Power BI Report embedded in Sharepoint online.
Hi Team, I want to edit and save a Power BI report which is embedded in Sahrepoint Online. What is the possible way to do this? I have tried Sandbox developer Playground. In that i'm able to get the edit and save option Javascript Code, but no idea how to use that in Sharepoint online. Thankyou in advance1KViews0likes2CommentsMulti parent hierarchy - custom visual D3.js
Hello Guys ! I create hierarchy table and what I want to achieve is something like this below: I know how to build hierarchy level for two categories and draw it, but I have a problem with 3 or more categories. My dataset is flat array of objects. Every object has id and parentId. I'm using d3.stratify() to make hierarchy nodes. It works properly but once I add third category which has two or more parents it crush. I found somewhere that hierarchy where children have many parents is not hierarchy anymore but graph. Is it right ? This is my stratify function: const root = d3 .stratify() .id(function (d: any) { return d.name; }) .parentId(function (d: any) { return d.parentId; })(items); This is my dataset transform when there is 3 categories: yAxis.map((d, i) => { if (yAxis.length === 3) { if (i === 2) { const children = data.filter( (d) => d.name === d.yAxis[d.yAxis.length - 1] ); uniqArray.push(children); } else if (i === 1) { const children = data.filter((d) => d.name === d.yAxis[1]); const filteredChildren = children.filter(function (a) { var key = a.name + "|" + a.parentName; if (!this[key]) { this[key] = true; return true; } }, Object.create(null)); uniqArray.push(filteredChildren); } else { const children = data.filter((d) => !d.parentId); uniqArray.push(_.uniqBy(children, (d) => d.name)); } return [..._.flatten(uniqArray), { name: "root" }]; } }); return yAxis.length > 1 ? [..._.flatten(uniqArray), { name: "root" }] : [...data, { name: "root" }]; Did you ever face that problem ? Or maybe you have some solution. I will be grateful for any advice how to do this. Thanks!Custom visual external Javascript in PowerBi Desktop Issue
Hi, We have custom visual component taht needs to use external javascript loaded using the script tag. The second library can't be embedded via node modules. Here is an extract from our source code : private scriptsUrl: string[] = [ "//cdnjs.cloudflare.com/ajax/libs/jquery/2.1.1/jquery.min.js", "https://api.bimsync.com/1.0/js/viewer.js"]; private loadNext = (resolve, reject) =>{ const scriptsUrlElement = this.scriptsUrl[this.loadCount]; let htmlScriptElement = document.createElement('script'); htmlScriptElement.src=scriptsUrlElement; htmlScriptElement.crossOrigin = "anonymous"; document.body.appendChild(htmlScriptElement); htmlScriptElement.onload = () => { console.info("Viewer scripts loaded"); this.loadCount++; if (this.loadCount >= this.scriptsUrl.length) { resolve(); }else{ this.loadNext(resolve, reject); } }; htmlScriptElement.onerror = (message, url, line, column, error) => { console.info("Viewer scripts error:" + error); reject({message,url,line,column,error}); }; } On web (PowerBi service) it works perfectly but on powerbi desktop we only have an object error (in the onerror) : { trusted:true } Is there a way to debug this on powerBI desktop or anything we should do ?power bi report run javascript on report load
We are running report server on premise. Our reports are accessed directly from report server and are not embedded in an application. We want the reports to open by default in full screen mode or with rs:Embed=True querystring. Is it possible to run a javascript on report open or report load? We understand that there is a javascript api for power bi service that can be used if you are embedding reports in your applications but, in our case, the requirement is to open the report directly from the report server and not embed it in an application.1.1KViews0likes1CommentChange between tabs automatically using java script
Hello people, I have this to change between power bi reports each 5 minutes, using javascript on a html page, this is for visualization purpose only: <html> <head> <script language=JavaScript> window.onload = hora; function recargar() { location.href=location.href } function hora(){ var fecha = new Date(); var minuto=fecha.getMinutes(); if (minuto % 2 == 0) { /*1*/ document.getElementById('EseMismo').src="https://app.powerbi.com/view?r=eyJrI..."; } else { /*2*/ document.getElementById('EseMismo').src="https://app.powerbi.com/view?r=eyJrI..."; } } setInterval('recargar()',300000); </script> <title>Global data</title> </head> <body style="background-color:rgb(235,234,232);"> <table> <tr> <td width="1800" height="650"> <div> <iframe id="EseMismo" width="100%" height="100%" src="https://app.powerbi.com/view?r=eyJrIjo..." frameborder="0" allowFullScreen="false"> </iframe> </div> </td> </tr> </table> </div> </body> </html> ¿Can I change between tabs on a power bi report instead on power bi reports? Thanks854Views0likes0CommentsUsing D3 for a gauge
Is there a way to put this D3 visual https://c3js.org/samples/chart_gauge.html or this one http://bl.ocks.org/msqr/3202712 into PowerBI? I've just inserted the JS Code inside de D3.JS Visual but it shows just a blank space... Here is the code var chart = c3.generate({ data: { columns: [ ['data', 91.4] ], type: 'gauge', onclick: function (d, i) { console.log("onclick", d, i); }, onmouseover: function (d, i) { console.log("onmouseover", d, i); }, onmouseout: function (d, i) { console.log("onmouseout", d, i); } }, gauge: { // label: { // format: function(value, ratio) { // return value; // }, // show: false // to turn off the min/max labels. // }, // min: 0, // 0 is default, //can handle negative min e.g. vacuum / voltage / current flow / rate of change // max: 100, // 100 is default // units: ' %', // width: 39 // for adjusting arc thickness }, color: { pattern: ['#FF0000', '#F97600', '#F6C600', '#60B044'], // the three color levels for the percentage values. threshold: { // unit: 'value', // percentage is default // max: 200, // 100 is default values: [30, 60, 90, 100] } }, size: { height: 180 } }); setTimeout(function () { chart.load({ columns: [['data', 10]] }); }, 1000); setTimeout(function () { chart.load({ columns: [['data', 50]] }); }, 2000); setTimeout(function () { chart.load({ columns: [['data', 70]] }); }, 3000); setTimeout(function () { chart.load({ columns: [['data', 0]] }); }, 4000); setTimeout(function () { chart.load({ columns: [['data', 100]] }); }, 5000); Any help is much appreciated!Solved