adding labels/columns with no data - Javascript highcharts

Javascript examples for highcharts:Chart Data

Description

adding labels/columns with no data

Demo Code

ResultView the demo in separate window

<html>
   <head> 
      <title>Highcharts Demo</title> 
      <meta name="viewport" content="width=device-width, initial-scale=1"> 
   </head> 
   <body> 
      <script src="https://code.highcharts.com/highcharts.js"></script> 
      <script src="https://code.highcharts.com/modules/drilldown.js"></script> 
      <script src="https://code.highcharts.com/modules/exporting.js"></script> 
      <script src="https://code.highcharts.com/modules/export-data.js"></script> 
      <div id="container" style="min-width: 310px; height: 400px; margin: 0 auto"></div> 
      <script type="text/javascript">
var data = [{/*w ww  .j  a va  2 s .c o m*/
   name: 'One',
  y: 10,
  drilldown: 'One'
}]
var drilldownData = [{
     id: 'One',
    data: [[272, 25.07], [297, 500.54]].map(elem => {
       return [elem[0].toString(), elem[1]]
    })
  }]
Highcharts.chart('container', {
    chart: {
        type: 'column'
    },
    title: {
        text: 'Monthly Average Temperature'
    },
    subtitle: {
        text: 'Source: WorldClimate.com'
    },
    xAxis: {
            type: 'category'
    },
    yAxis: {
        title: {
            text: 'Temperature (?C)'
        }
      },
    series: [{
        name: 'Tokyo',
        data: data
    }],
    drilldown: {
       series: drilldownData
    }
});

      </script>  
   </body>
</html>

Related Tutorials