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

176
Visualizações
D3 draw text in Arc without underline in text

I am working with D3 lib to show bubble chart. Everything is good util I draw a text in arc. To draw arc and text, I read in: https://www.visualcinnamon.com/2015/09/placing-text-on-arcs/. So, I want to draw text like this: Expected[1] [1]: https://i.stack.imgur.com/2KN5x.png In my opinion, I will create 2 arcs with 1 arc is hidden and append text. To create a arc path, I have: M start-x, start-y A radius-x, radius-y, x-axis-rotation, large-arc-flag, sweep-flag, end-x, end-y. But when I create, I difficulty when draw coordinates start_x and start_y, end_x, end_y. This is my output. My output[2] [2]: https://i.stack.imgur.com/Lwplg.png My code of arc hidden:

.attr('d', function (d, i) {
          const start_x = d.r * k;
          const start_y = 0;
          return 'M ' + -start_x + ' ' + start_y + ' A ' + start_x  + ' ' + start_x + ' 0 0 1 ' + start_x + ' ' + start_y;
        })

And code of arc show:

.attr('d', function (d, i) {
          const start_x = d.r * k;
          const start_y = 0;
          return 'M ' + -start_x + ' ' + start_y + ' A ' + start_x + ' ' + start_x + ' 0 1 0 ' + start_x + ' ' + start_y;
        })

I try increase coordinate_x and coordinate_y at start point and end point but it's not true. Ignore about color, I hope that anyone can help this. You can checkout source code in: https://github.com/hunghaui2310/d3-bubble-chart Check it in 507 line of /js/script.js. Thanks all

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