Highcharts Interval Column Chart

To create an interval column chart using Highcharts, you can follow these steps:

  • Include the Highcharts library in your HTML file. You can either download it from the Highcharts website or include it from a CDN like this:
<script src="https://code.highcharts.com/highcharts.js"></script>
  • Create a container element for the chart in your HTML file, like this:
<div id="chart-container"></div>
  • In your JavaScript code, create a Highcharts chart object and configure it with the data and chart options. For example:
Highcharts.chart('chart-container', {
  chart: {
    type: 'columnrange'
  },
  title: {
    text: 'Interval Column Chart'
  },
  xAxis: {
    categories: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']
  },
  yAxis: {
    title: {
      text: 'Temperature (��C)'
    }
  },
  tooltip: {
    valueSuffix: '��C'
  },
  plotOptions: {
    series: {
      borderWidth: 0,
      dataLabels: {
        enabled: true,
        format: '{point.low} - {point.high}��C'
      }
    }
  },
  series: [{
    name: 'Temperature',
    data: [
      [-5.8, -0.9],
      [-3.3, 3.5],
      [-1.1, 8.4],
      [-0.6, 11.5],
      [-5.3, 3.9],
      [-6.5, 0.6],
      [-6.7, -1.8],
      [-6.9, -2.2],
      [-5.6, 0.8],
      [-4.5, 2.4],
      [-4.5, 2.8],
      [-4.7, 1.7]
    ]
  }]
});

In this example, we're creating an interval column chart with the Highcharts chart function and passing in a set of options:

  • chart.type is set to 'columnrange' to create a column range chart
  • title.text is set to 'Interval Column Chart' to set the main title
  • xAxis.categories is set to an array of category labels for the x-axis
  • yAxis.title is set to set the label for the y-axis
  • tooltip.valueSuffix is set to '��C' to set the tooltip suffix
  • plotOptions.series.dataLabels is set to an object to enable data labels for each data point and format the label text
  • series is set to an array of objects with a name and data property to define the series data

In the series.data option, we're specifying an array of arrays that define the low and high values for each column in the chart. The first value in each array specifies the low value, and the second value specifies the high value.

With these options, you can create an interval column chart with customizable data and appearance.

  1. Customizing appearance in Highcharts Interval Column Chart: To customize the appearance of an Interval Column Chart in Highcharts, you can use various options like colors, borders, width, and more. Here's an example code snippet:

    Highcharts.chart('container', {
        chart: {
            type: 'column'
        },
        plotOptions: {
            column: {
                color: 'steelblue',
                borderWidth: 1,
                borderColor: 'white',
                borderRadius: 5
            }
        },
        series: [{
            name: 'Data',
            data: [10, 15, 20, 25, 30]
        }]
    });
    
  2. Adding data to Highcharts Interval Column Chart: To add data to the Interval Column Chart, you can use the data property within the series object. Each data point represents the height of the column. Here's an example:

    series: [{
        name: 'Data',
        data: [10, 15, 20, 25, 30]
    }]
    
  3. Stacked Interval Column Chart in Highcharts: To create a stacked Interval Column Chart, you can set the stacking property in the plot options. Here's an example:

    plotOptions: {
        column: {
            stacking: 'normal'
        }
    },
    series: [{
        name: 'Category 1',
        data: [10, 15, 20]
    }, {
        name: 'Category 2',
        data: [5, 10, 15]
    }]
    
  4. Grouped Interval Column Chart using Highcharts: To create a grouped Interval Column Chart, you can leave out the stacking property. Here's an example:

    plotOptions: {
        column: {
            // No stacking property for grouped chart
        }
    },
    series: [{
        name: 'Category 1',
        data: [10, 15, 20]
    }, {
        name: 'Category 2',
        data: [5, 10, 15]
    }]
    
  5. Interactive features in Highcharts Interval Column Chart: Highcharts supports interactive features like tooltips, click events, and legends. You can enable these features to enhance user interaction. Here's a snippet for tooltip configuration:

    tooltip: {
        pointFormat: 'Value: {point.y}'
    }