data label selected when setting useHTML=true - Javascript highcharts

Javascript examples for highcharts:Chart Label

Description

data label selected when setting useHTML=true

Demo Code

ResultView the demo in separate window

<html>
   <head> 
      <meta name="viewport" content="width=device-width, initial-scale=1"> 
      <script type="text/javascript" src="https://code.jquery.com/jquery-1.9.1.js"></script> 
      <script type="text/javascript">
$(function () {/*from  w w  w.ja va  2  s  .  c o m*/
    $('#container').highcharts({
        chart: {},
        plotOptions: {
            pie: {
                dataLabels: {
                    useHTML: true,
                }
            }
        },
        series: [{
            type: 'pie',
            data: [
                ['AAA', 10],
                ['BBB', 20],
                ['CCC', 15]
            ]
        }]
    }, function (chart) {
        $.each(chart.series[0].data, function (i, d) {
            $('.highcharts-data-labels div span').eq(i).mouseover(function (e) {
                chart.tooltip.refresh(d);
            });
        });
    });
});

      </script> 
   </head> 
   <body> 
      <script src="https://code.highcharts.com/highcharts.js"></script> 
      <div id="container" style="min-width: 310px; height: 400px; max-width: 600px; margin: 0 auto"></div>  
   </body>
</html>

Related Tutorials