Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

234
Visualizações
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 à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda