show results without comma for individual line in line chart - Javascript highcharts

Javascript examples for highcharts:Line Chart

Description

show results without comma for individual line in line chart

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 v  a  2s . co  m*/
  $('#container').highcharts({
    title: {
      text: '',
      x: -20 //center
    },
    colors: ['blue', 'red', ],
    plotOptions: {
      line: {
        lineWidth: 3
      },
      tooltip: {
        hideDelay: 200
      }
    },
    subtitle: {
      text: '',
      x: -20
    },
    xAxis: {
      categories: [
        ''
      ]
    },
    yAxis: [{
      min: 0,
      title: {
        text: ''
      }
    }, {
      title: {
        text: ''
      },
      opposite: true
    }],
    tooltip: {
      pointFormat: '<span style="color:{series.color}">{series.name}</span>: <b>{point.y:.0f} h</b><br/>',
      valueSuffix: ' h',
      crosshairs: true,
      shared: true
    },
    legend: {
      layout: 'vertical',
      align: 'right',
      verticalAlign: 'middle',
      borderWidth: 1
    },
    plotOptions: {
      line: {
        dataLabels: {
          enabled: true,
          formatter: function() {
            if (this.series.name == '3')
              return Highcharts.numberFormat(this.y, 0);
            else
              return Highcharts.numberFormat(this.y, 2);
          }
        },
        enableMouseTracking: true
      }
    },
    series: [{
      name: '1',
      color: 'rgba(51, 204, 204, 0.75)',
      lineWidth: 2,
      data: [4.12, 3.34, 5.45]
    }, {
      name: '2',
      color: 'rgba(255, 77, 77,0.75)',
      marker: {
        radius: 6
      },
      data: [3.45, 5.45, 3.23]
    }, {
      name: '3',
      color: '#bfbfbf',
      marker: {
        radius: 6
      },
      data: [7.34, 4.23, 1.78]
    }]
  });
});

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

Related Tutorials