Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

188
Vistas
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
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda