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

225
Vistas
D3 Styles Not Being Applied

I am trying to produce a bar chart using d3 but I cannot seem to properly apply the styling. I import the data using d3.dsv(...) and then call

.then(function (data) {
      d3.select("body").selectAll("div")
        .data(data)
        .enter()
        .append("div")
        .styles({
          'width': '5px',
          'background-color': 'teal',
          'margin-right': '2px'
        })
        .style("height", function (d) {
          return d.total_amount + "px"
        }); 

I can see that there is a new div being created for each element in data but none of the styling is being applied. I've looked through some of the other posts here but I still don't see what I'm doing wrong.

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