2011-10-20 13 views

Respuesta

41

Para ello, adjunte un controlador al evento legendItemClick y simplemente devuelva false. Esto evitará la acción predeterminada que consiste en alternar el sector circular.

point: { 
    events: { 
     legendItemClick: function() { 
      return false; // <== returning false will cancel the default action 
     } 
    } 
} 

ver este ejemplo http://jsfiddle.net/mfras3r/3vVGB/1/

+0

Gracias - trabajaron :) – highchartsdude

+3

El violín ha mencionado ya no funciona en la versión actual de Highcharts. He actualizado el código para que funcione con la versión 3.0.2 - http://jsfiddle.net/mfras3r/3vVGB/1/ – mfras3r

+2

Cuando leo la documentación, legendItemClick no es un método de 'series.point.events' sino directamente de 'series.events': http://api.highcharts.com/highcharts#plotOptions.series.events – moi

4
pie: { 
    showInLegend: true, 
    allowPointSelect: false, 
    point:{ 
     events : { 
     legendItemClick: function(e){ 
      e.preventDefault(); 
     } 
     } 
    } 
} 
2
pie: { 
    showInLegend: true, 
    allowPointSelect: false, // disable selected 
} 
+1

Es una buena práctica en Stack Overflow agregar una explicación de por qué su solución debería funcionar. Para obtener más información, lea [Cómo responder] (http://stackoverflow.com/help/how-to-answer). –

+0

@FabianSchultz Gracias. – mamian

Cuestiones relacionadas