Highcharts Demo

author(s): Øystein Moseng

by Salehin Modasiya

HTML

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

<div id="container" style="height: 400px; max-width: 800px; margin: 0 auto"></div>

JavaScript

Highcharts.chart('container', {
    chart: {
        type: 'column'
    },

    title: {
        text: 'Pattern fill plugin demo'
    },

    xAxis: {
        categories: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']
    },

    plotOptions: {
       
    },

    series: [{
        type: 'column',
        pointWidth: 110,
        pointPadding: 0.25,
        borderColor: 'transparent',
        borderWidth: 0,
        data: [{
            name: 'Petronas',
            y: 100,
            color: {
                pattern: {
                    path: {
                d: 'M 3 3 L 8 3 L 8 8 Z',
               fill: '#102045'
           },
           width: 12,
           height: 12,
           color: '#907000',
           opacity: 0.5
                }
            }
        }, {
            name: 'Pisa',
            y: 150,
            color: {
                pattern: {
                    path: {
                d: 'M 3 3 L 8 3 L 8 8 Z',
               fill: '#102045'
           },
           width: 12,
           height: 12,
           color: '#907000',
           opacity: 0.5
                }
            }
        }, {
            name: 'Eiffel tower',
            y: 200,
            color: {
                pattern: {
                    image: 'https://www.svgrepo.com/show/19456/tokyo-tower.svg',
                    aspectRatio: 0.8
                }
            }
        }, {
            name: 'Ahu-tongariki',
            y: 250,
            color: {
                pattern: {
                    image: 'https://www.svgrepo.com/show/27081/ahu-tongariki.svg',
                    aspectRatio: 0.75
                }
            }
        }]
    }]
});