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

218
Vistas
Remove SVG rendered path on Legend Item Click

This is my jsfiddle

I'm plotting the Arrow mark at the end of some series by rendering the path element. When I hide other legends arrow mark gets shifted, without removing rendered arrow mark.

I tried removing rendered elements using the below ways

  1. by using destroy method on the arrow mark series.
plotOptions: {
  series: {
   events: {
     legendItemClick: {
//svgElements are retrieved from called function which draws arrow mark
     svgElements.forEach((ele) => {
                  if(ele.d !== 'M 0 0')
                    ele.destroy();
                })
   }
  }
 }
}
  1. by using the remove method
svgElements.forEach((ele) => {
                  if(ele.d !== 'M 0 0')
                    ele.element.remove();
                })
  1. by using id on SVG
svgElements.forEach((ele) => {
                  if(ele.d !== 'M 0 0')
                    $('#legend4').remove();
                })
  1. by using safeRemoveChild method
svgElements.forEach((ele) => {
                  if(ele.d !== 'M 0 0')
                    ele.safeRemoveChild(ele.element);
                })

But none of them worked. Any suggestions will be helpful.

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

You don't need to remove the custom arrows, it is enough if you update their positions. For example:

if (series.customArrow) {
  series.customArrow.attr({
    d: path
  })
} else {
  series.customArrow = series.chart.renderer.path(path)
    .attr({
      fill: series.color
    })
    .add(series.group);
}

Live demo: https://jsfiddle.net/BlackLabel/wv41sqro/

API Reference: https://api.highcharts.com/class-reference/Highcharts.SVGElement

about 4 years ago · Juan Pablo Isaza Denunciar
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