Highcharts Area Range Chart

In the previous chapters, we learned how to setup highcharts library and how to create a chart with required configurations using highcharts library in our webpage. Now, we will learn how to create an area range chart using highcharts library with examples.

Highcharts Area Range Chart Example

Following is the example of creating an area range chart by setting the required area chart properties using highcharts library.

 

<html>

<head>

    <title>Highcharts Area Range Chart</title>

    <script src="https://code.jquery.com/jquery-3.4.1.min.js"></script>

    <script src="https://code.highcharts.com/highcharts.js"></script>

    <script src="https://code.highcharts.com/modules/data.js"></script>

    <script src="https://code.highcharts.com/highcharts-more.js"></script>

    <script src="https://code.highcharts.com/modules/exporting.js"></script>

    <script type="text/javascript">

        $(function() {

            $.getJSON(

                'https://cdn.jsdelivr.net/gh/highcharts/highcharts@v7.0.0/samples/data/range.json',

                function(data) {

                    Highcharts.chart('container', {

                        chart: {

                            type: 'arearange',

                            zoomType: 'x',

                            scrollablePlotArea: {

                                minWidth: 600,

                                scrollPositionX: 1

                            }

                        },

                        title: {

                            text: 'Temperature variation by day'

                        },

                        xAxis: {

                            type: 'datetime'

                        },

                        yAxis: {

                            title: {

                                text: null

                            }

                        },

                        tooltip: {

                            crosshairs: true,

                            shared: true,

                            valueSuffix: '°C'

                        },

                        legend: {

                            enabled: false

                        },

                        series: [{

                            name: 'Temperatures',

                            data: data

                        }]

                    });

                }

            );

        });

    </script>

</head>

<body>

    <div id="container" style="width: 100%; height: 400px;"> </div>

</body>

</html>

If you observe the above example, we created an area range chart using highcharts library with required properties.

 

When we execute the above highcharts example, we will get the result like as shown below.

 

Highcharts Area Range Chart Example Result

 

This is how we can create an area range chart using highcharts library with required properties.

Topics Covered