need help
189 TopicsGetting Refused to connect to X because it violates the following Content Security Policy directive
Dear community, On a custom visual I am trying use a http post request by fetch to a logic app endpoint, and getting following error from the Console: Refused to connect to 'https://xxx.logic.azure.com/xxx' because it violates the following Content Security Policy directive: "default-src 'self' data: blob: 'unsafe-inline' 'unsafe-eval'". Note that 'connect-src' was not explicitly set, so 'default-src' is used as a fallback. Following is the code from the react component of the visual: handleClick = () => { fetch('https://xxx.logic.azure.com:443/xxx', { method: 'POST', mode: 'cors', body: JSON.stringify({"Data": {"Text1": "Test5", "Text2": "Test6"}}) // body data type must match "Content-Type" header }) I have read up on CSP and best I could find was: https://learn.microsoft.com/en-us/power-bi/developer/visuals/capabilities#privileges-define-the-special-permissions-that-your-visual-requires For which reason I have tried to add to capabiltities.json the following: "privileges": [ { "name": "WebAccess", "essential": true, "parameters": [ "https://prod-23.northeurope.logic.azure.com/", "https://*.logic.azure.com/", "https://prod-23.northeurope.logic.azure.com:443/", "*.logic.azure.com:443/" ] }, { "name": "ExportContent", "essential": true } ] } Anyone got some ideas? Is it at all possible to do http request from a visual or has it been entirely blocked out by MS on the Power BI service? Best regards and thanks.json and custom visuals with power bi theme possible?
Hi, We have a .json theme file and can customise vast majority of properties of visuals which ship with power bi o.k e.g. background. However, when try and set the propertries of a custom visual such as advance card as per below - no impact .eg. background property unchanged when import theme file unlike other visuals which change the background as expected. Does anyone know if possible to use custom visuals in the .json theme file or not? Just wondering if possible to use custom visuals in the .json theme file? "advanceCard": { "*": { "labels": [{ "color": { "solid": { "color": "#063d73"}}, "fontSize": 14 }], "background": [{ "show": true, "transparency": 70, "color": { "solid": { "color": "#Febe10" } } }] } }Solved19KViews0likes16CommentsDened - Custom Matrix with double headers
Hi dm-p, I hope you can help me here to deliver a matrix view in Deneb to look like this: I aim to show the Category and Sub-category at the top of the matrix and colour the cells based on the values. So far, here is my code: { "data": {"name": "dataset"}, "encoding": { "y": { "field": "Product", "title": null }, "x": { "field": "Sub Cat", "axis": { "orient": "top" } } }, "layer": [ { "mark": {"type": "rect"}, "encoding": { "color": { "field": "Value", "scale": { "scheme": "lightgreyred" }, "legend": null } } }, { "mark": { "type": "text", "tooltip": true, "fontsize": 14 }, "encoding": { "text": { "field": "Value", "type": "quantitative", "format": ",.0f" }, "color": {"value": "black"} } } ] } And below is the output I got so far: I was hoping that when defining the "x" "field", I could add multiple fields ... but I am unsure how to do it. Many thanks Sample fileSolvedRadar Chart - Can you please include Tooltip Option?
I have imported the default Microsoft Radar Chart into my report. However, it does not include the Tooltip option, and as such, not able to customise the Tooltip report for this visual. May I request that this feature is included in this visualization! Thank you! CC: @pleblancSolvedidentifying visualname in Custom Visuals
Hi v-evelk The following links: https://community.powerbi.com/t5/Desktop/Custom-Report-Theme-JSON-Property-settings-in-Tables-Matrix/td-p/278177/page/2 https://docs.microsoft.com/en-us/power-bi/desktop-report-themes (under "JSON file element definitions") show how to customize different visualnames using JSON for embedded visuals in Power BI, e.g, "scatterChart" or "clusteredColumnChart". I've used this to reduce the fontsize of embedded visusals to a number below the minimum 8 pt allowed for in PowerBI. I'd like to do the same for Custom Visuals, and in some cases change the fontfamily as well. In order to do so, I assume I need the correct visualName for custom visuals, e.g. Aster Plot or Timeline slicer, but don't know how to find/identify what those visualNames are. How can I find/identify those visualnames for custom visuals?SolvedVega-lite Deneb: How to make labels more readable on bubble chart
I have a bubble chart on Power BI that I made using the Deneb visual in Vega-lite. I am new to Vega-lite so I'm still learning. I want each bubble to have a label with the title for that row. However, I want to make it so the labels don't overlap if possible. Is there a way to make the labels not overlap? The labels also overlap the legend on the right. I was also thinking about filtering so that only larger bubbles have a label, but I'm not sure how to do that either. Here is a screenshot showing how the labels overlap each other and the legend. Here is my script with some dummy data to show the issue: { "$schema": "https://vega.github.io/schema/vega-lite/v5.json", "data": { "name": "dataset" }, "width": 950, "height": 400, "encoding": { "x": { "field": "Date", "type": "temporal", "axis": {"grid": false, "format":"Q%q %Y"} }, "y": { "field": "Prob", "type": "quantitative", "axis": {"title": "prob"} }, "tooltip" : [ {"field":"Title", "type": "nominal"}, {"field":"Group", "type": "nominal"}, {"field":"Section", "type": "nominal"}, {"field":"Amount", "type": "nominal"}, {"field":"ID#", "type":"nominal"}, {"field":"Description", "type":"nominal"} ] }, "layer":[{ "mark":{ "type": "circle", "opacity": 0.8, "stroke": "black", "strokeWidth": 1 }, "encoding": { "size": { "field": "Amount", "type": "quantitative", "title": "", "legend": "", "scale": {"rangeMax": 1000} }, "color": { "field": "Group", "type": "nominal" } } }, { "mark":{ "type": "circle", "opacity": 0.8, "stroke": "black", "strokeWidth": 1 }, "encoding": { "size": { "field": "Amount", "type": "quantitative", "title": "", "legend": "", "scale": {"rangeMax": 1000} }, "color": { "field": "Group", "type": "nominal" } } }, { "mark":{ "type": "text", "align": "left", "baseline": "top", "dx":8, "limit":150, "angle":-25 }, "encoding": { "text":{"field":"Title", "type":"nominal"} }, "transform": [ { "type": "label", "anchor": ["top", "bottom", "right", "left"], "offset": [1], "size": {"signal": "[width + 60, height]"} } ] } ] }5.4KViews0likes1CommentCustom visual development - issue rendering font "DIN"
Hi All. We have an issue with rendering DIN font in our custom visual. Issue: DIN font rendered by our custom visual do not match the same font (with same color, size...) by built-in card visual. Code: private eleDinTest: d3.Selection<SVGElement>; ... this.eleDinTest .text("Test DIN") .style("font-size", 20 + "pt") // or .style("font-size", 20 + "px") .style("font-family", "DIN") .style("font-weight", "Normal") .style("fill", "#000000"); Any additional style and/or attribute settings required? Any help is much appreciated. Thanks in advance.SolvedIs it possible to use Chart.JS to create a Power BI Custom visual ?
Hello, I would like to use the Chart.JS library to create my visual. To do this, I referred to this tutorial: https://medium.com/@jatin7gupta/adding-external-js-libraries-powerbi-custom-visuals-9b0b9a7d4ae But when I execute pbiviz start, the visual is completely blank. So I wanted to know if it is possible to use Chart.JS to develop a custom visual and if so, how can I fix my code to display the visual?SolvedCustom visual Table using Javascript : Filter Row, Column and single Cell
Hi everybody, I am writing here hoping to find someone who can help me to find the correct way to develop a custom table visual for power BI. At this moment I am able to take data from capabilites file using: var table: DataViewTable = options.dataViews[0].table var columns: DataViewMetadataColumn[] = table.columns; var rows: DataViewTableRow[] = table.rows; After that I manipulate it and I put them in a html table(thead and tbody). var columnsName = []; for (var i = 0; i < columns.length; i++) { columnsName[i] = columns[i].displayName } var stringToBuild = "[" for (var i = 0; i < rows.length; i++) { stringToBuild += "{" for (var j = 0; j < columnsName.length; j++) { var colName = columnsName[j] var newLocal = rows[i][j]; stringToBuild += "\"" + colName + "\": " + "\"" + newLocal + "\"" if (j != columnsName.length - 1) { stringToBuild += "," } } stringToBuild += "}" if (i != rows.length - 1) { stringToBuild += "," } } stringToBuild += "]" var valueToRepresent =JSON.parse(stringToBuild) this.thead.append('tr') .selectAll('th') .data(columnsName) .enter() .append("th") .text(function (columnsName) { return columnsName; }) .style("background-color", this.settings.headerFormatting.color) .style("font-size", this.settings.headerFormatting.size + "px") .style("color",this.settings.headerFormatting.colorFont); // create a row for each object in the data this.tbody.selectAll('tr') .data(valueToRepresent) .enter() .append('tr'); // create a cell in each row for each column var cells = this.tbody.selectAll('tr').selectAll('td') .data(function (row) { return columnsName.map(function (column) { return { column: column, value: row[column] }; }); }) .enter() .append('td') .text(function (d) { return d.value; }); This way it works fine. Now my next goal is to add the possibility to chick on row and filter all the visuals based on that row. Anyone can help me?Solved4.7KViews0likes6CommentsJSON issue for new card visual
I have the following JSON code for the NEW card visual. It is applying most of what I'm specifying, but it ignores "padding" and it ignores the color specification for the card value. What do I need to change to fix this? "cardVisual": { "*": { "labels": [ { "color": { "solid": { "color": "#666666" } }, "position": "BelowValue" } ], "categoryLabels": [ { "color": { "solid": { "color": "#666666" } } } ], "values": [ { "color": { "solid": { "color": "#666666" } }, "horizontalAlignment": "Center" } ], "padding": [ { "top": 0, "left": 0, "right": 0, "bottom": 0 } ], "cards": [ { "fill": { "show": false } } ] } }