Highcharts Pyramid 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 a pyramid chart using highcharts library with examples.

Highcharts Pyramid Chart Example

Following is the example of creating a pyramid chart by setting the required chart properties using highcharts library.

 

Live Preview

<html>

<head>

    <title>Highcharts Pyramid 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/funnel.js"></script>

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

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

    <script type="text/javascript">

        $(function() {

            Highcharts.chart('container', {

                chart: {

                    type: 'pyramid'

                },

                title: {

                    text: 'Sales pyramid',

                    x: -50

                },

                plotOptions: {

                    series: {

                        dataLabels: {

                            enabled: true,

                            format: '<b>{point.name}</b> ({point.y:,.0f})',

                            color: (Highcharts.theme && Highcharts.theme.contrastTextColor) || 'black',

                            softConnector: true

                        },

                        center: ['40%', '50%'],

                        width: '80%'

                    }

                },

                legend: {

                    enabled: false

                },

                series: [{

                    name: 'Unique users',

                    data: [

                        ['Website visits', 15654],

                        ['Downloads', 4064],

                        ['Requested price list', 1987],

                        ['Invoice sent', 976],

                        ['Finalized', 846]

                    ]

                }]

            });

        });

    </script>

</head>

<body>

    <div id="container"></div>

</body>

</html>

If you observe the above example, we created a pyramid chart by using highcharts library with required properties.

 

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

 

Highcharts pyramid chart example result

 

This is how we can create a pyramid chart using highcharts library with required properties. 

Topics Covered