Estoy trabajando con D3 lib para mostrar el gráfico de burbujas. Todo está bien hasta que dibujo un texto en arco. Para dibujar arco y texto, leo en: https://www.visualcinnamon.com/2015/09/placeing-text-on-arcs/ . Entonces, quiero dibujar un texto como este: Esperado [1] [1]: https://i.stack.imgur.com/2KN5x.png En mi opinión, crearé 2 arcos con 1 arco oculto y agregaré texto . Para crear una ruta de arco, tengo: M inicio-x, inicio-y A radio-x, radio-y, rotación del eje x, bandera de arco grande, bandera de barrido, final-x, final-y. Pero cuando creo, tengo dificultad para dibujar las coordenadas start_x y start_y, end_x, end_y. Esta es mi salida. Mi salida[2] [2]: https://i.stack.imgur.com/Lwplg.png Mi código de arco oculto:
.attr('d', function (d, i) { const start_x = dr * k; const start_y = 0; return 'M ' + -start_x + ' ' + start_y + ' A ' + start_x + ' ' + start_x + ' 0 0 1 ' + start_x + ' ' + start_y; })Y el código de arco muestra:
.attr('d', function (d, i) { const start_x = dr * k; const start_y = 0; return 'M ' + -start_x + ' ' + start_y + ' A ' + start_x + ' ' + start_x + ' 0 1 0 ' + start_x + ' ' + start_y; })Intento aumentar las coordenadas_x y las coordenadas_y en el punto de inicio y en el punto final, pero no es cierto. Ignorar sobre el color, espero que alguien pueda ayudar con esto. Puede consultar el código fuente en: https://github.com/hunghaui2310/d3-bubble-chart Compruébelo en la línea 507 de /js/script.js. Gracias a todos