Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

186
Views
Problema que muestra el gráfico de barras con D3 js en Power PI

Intenté poner los códigos y el estilo D3 js y agregué el conjunto de datos como se muestra en la imagen a continuación. Sin embargo, el gráfico de barras no se muestra en Power BI. El tipo de conjunto de datos que estoy usando es un archivo de texto (.txt)

ingrese la descripción de la imagen aquí

 These are the D3 js for the bar chart. var margin = {top: 20, right: 20, bottom: 30, left: 40}, width = pbi.width - margin.left - margin.right, // ALTER: Changed fixed width with the 'pbi.width' variable height = pbi.height - margin.top - margin.bottom; // ALTER: Changed fixed height with the 'pbi.height' variable var x = d3.scale.ordinal() .rangeRoundBands([0, width], 0.1, 0.2); var y = d3.scale.linear() .range([height, 0]); var svg = d3.select("#chart") .attr("width", width + margin.left + margin.right) .attr("height", height + margin.top + margin.bottom) .append("g") .attr("transform", "translate(" + margin.left + "," + margin.top + ")"); // ALTER: Replaced the d3.tsv function with the pbi variant: pbi.dsv pbi.dsv(type, function(letters) { x.domain(letters.map(function(d) { return d.letter; })); y.domain([0, d3.max(letters, function(d) { return d.frequency; })]); svg.append("g") .attr("class", "x axis") .attr("transform", "translate(0," + height + ")") .call(d3.svg.axis().scale(x).orient("bottom")); svg.append("g") .attr("class", "y axis") .call(d3.svg.axis().scale(y).orient("left")); svg.selectAll(".bar") .data(letters) .enter() .append("rect") .style("fill", pbi.colors[0]) // First color of provided color array .attr("x", function(d) { return x(d.letter); }) .attr("width", x.rangeBand()) .attr("y", function(d) { return y(d.frequency); }) .attr("height", function(d) { return height - y(d.frequency); }); }); function type(d) { d.frequency = +d.frequency; return d; }
 These are the CSS for the bar chart. body { font: 10px sans-serif; } .axis path, .axis line { fill: none; stroke: #000; shape-rendering: crispEdges; } .x.axis path { display: none; }

He intentado usar los códigos D3 js y CSS anteriores, sin embargo, no sé por qué el gráfico de barras no aparece en Power BI.

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!