Highcharts Curve Area Chart

To create a curve area chart in 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: 'areaspline'
  },
  title: {
    text: 'Curve Area Chart'
  },
  xAxis: {
    categories: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']
  },
  yAxis: {
    title: {
      text: 'Temperature (��C)'
    }
  },
  series: [{
    name: 'Tokyo',
    data: [7.0, 6.9, 9.5, 14.5, 18.2, 21.5, 25.2, 26.5, 23.3, 18.3, 13.9, 9.6],
    fillColor: {
      linearGradient: [0, 0, 0, 300],
      stops: [
        [0, Highcharts.getOptions().colors[0]],
        [1, 'rgba(255,255,255,0)']
      ]
    }
  }]
});

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

  • chart.type is set to 'areaspline' to create a curve area chart
  • title.text is set to 'Curve Area Chart' to set the main title
  • xAxis.categories is set to an array of month names to set the x-axis labels
  • yAxis.title.text is set to 'Temperature (��C)' to set the y-axis label
  • series is set to an array with one object containing name, data, and fillColor properties to set the chart data and styling options
  • fillColor is set to configure the color of the area under the curve, using a linear gradient with two stops: the first stop is set to the primary color of the chart, and the second stop is set to transparent white to create a fade-out effect

Note that you can customize many other options to further customize your curve area chart, such as the line color, thickness, and style, the chart background color, and the legend position and styling. You can find more details and examples in the Highcharts documentation.

  1. Customizing appearance in Highcharts Curve Area Chart:

    • Customize the appearance of the Curve Area Chart with various options.
    Highcharts.chart('container', {
        chart: {
            type: 'areaspline',
            backgroundColor: '#f2f2f2',
            borderRadius: 10,
            borderWidth: 2,
            borderColor: '#999999'
        },
        title: {
            text: 'Customizing Highcharts Curve Area Chart'
        },
        xAxis: {
            categories: ['Jan', 'Feb', 'Mar', 'Apr', 'May'],
            title: {
                text: 'Months'
            }
        },
        yAxis: {
            title: {
                text: 'Values'
            }
        },
        series: [{
            name: 'Series 1',
            data: [5, 10, 15, 20, 25],
            color: '#64b4dc',
            fillColor: {
                linearGradient: { x1: 0, y1: 0, x2: 0, y2: 1 },
                stops: [
                    [0, '#64b4dc'],
                    [1, Highcharts.Color('#64b4dc').setOpacity(0).get('rgba')]
                ]
            }
        }],
        // Additional configuration options...
    });
    
  2. Adding data to Highcharts Curve Area Chart:

    • Populate the Curve Area Chart with data points.
    series: [{
        name: 'Series 1',
        data: [5, 10, 15, 20, 25],
        color: '#64b4dc',
        fillColor: {
            linearGradient: { x1: 0, y1: 0, x2: 0, y2: 1 },
            stops: [
                [0, '#64b4dc'],
                [1, Highcharts.Color('#64b4dc').setOpacity(0).get('rgba')]
            ]
        }
    }, {
        name: 'Series 2',
        data: [15, 5, 20, 10, 25],
        color: '#ff9900',
        fillColor: {
            linearGradient: { x1: 0, y1: 0, x2: 0, y2: 1 },
            stops: [
                [0, '#ff9900'],
                [1, Highcharts.Color('#ff9900').setOpacity(0).get('rgba')]
            ]
        }
    }],
    
  3. Highcharts Curve Area Chart live demo:

    • Explore a live demo of the Highcharts Curve Area Chart on your website.
    <div id="container"></div>
    <script src="https://code.highcharts.com/highcharts.js"></script>
    <script src="https://code.highcharts.com/modules/exporting.js"></script>
    <script src="https://code.highcharts.com/modules/export-data.js"></script>
    <script src="https://code.highcharts.com/modules/accessibility.js"></script>
    <script>
        // Highcharts Curve Area Chart configuration here...
    </script>
    
  4. Highcharts Curve Area Chart configuration options:

    • Explore various configuration options for fine-tuning the Curve Area Chart.
    chart: {
        type: 'areaspline',
        backgroundColor: '#f2f2f2',
        borderRadius: 10,
        borderWidth: 2,
        borderColor: '#999999'
    },
    title: {
        text: 'Curve Area Chart Configuration Options'
    },
    xAxis: {
        // Configuration options for X-axis
    },
    yAxis: {
        // Configuration options for Y-axis
    },
    series: [{
        // Configuration options for the series
    }],
    // Additional configuration options...
    
  5. Stacked Curve Area Chart in Highcharts:

    • Create a stacked Curve Area Chart for visualizing multiple datasets.
    plotOptions: {
        areaspline: {
            stacking: 'normal',
            fillOpacity: 0.5
        }
    },
    series: [{
        name: 'Series 1',
        data: [5, 10, 15, 20, 25],
        color: '#64b4dc'
    }, {
        name: 'Series 2',
        data: [15, 5, 20, 10, 25],
        color: '#ff9900'
    }],
    
  6. Grouped Curve Area Chart using Highcharts:

    • Display multiple Curve Area series side by side without stacking.
    plotOptions: {
        areaspline: {
            stacking: null,
            fillOpacity: 0.5
        }
    },
    series: [{
        name: 'Series 1',
        data: [5, 10, 15, 20, 25],
        color: '#64b4dc'
    }, {
        name: 'Series 2',
        data: [15, 5, 20, 10, 25],
        color: '#ff9900'
    }],
    
  7. Interactive features in Highcharts Curve Area Chart:

    • Implement interactive features for a better user experience.
    series: [{
        name: 'Series 1',
        data: [5, 10, 15, 20, 25],
        color: '#64b4dc',
        events: {
            click: function (event) {
                alert('Clicked on ' + this.name + ' at ' + event.x + ', ' + event.y);
            }
        }
    }],