JSFiddle - React, Tailwind, and code Playground

by agorur

HTML

<script type="text/javascript" src="http://highcharts.com/js/highcharts.js"></script>
 <script type="text/javascript" src="http://highcharts.com/js/modules/exporting.js"></script>

    <p>Add Custom button to the exporting </p>
    <div id="container1" style="width:400px; height: 220px;"></div>

JavaScript

var chart1;
        $(document).ready(function () {

            //Add button
            chart1 = new Highcharts.Chart({
                chart: {
                    renderTo: 'container1',
                    shadow: true
                },
                title: { text: 'Sales' },
                xAxis: {
                    categories: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']
                },
                yAxis: { title: { text: '$'} },
                series: [{
                    data: [29.9, 71.5, 106.4, 129.2, 144.0, 176.0, 135.6, 148.5, 216.4, 194.1, 95.6, 54.4]
                }],
                exporting: {
                        buttons: {
                            'exportTo': {
                                _id: 'exportTo',
                                symbol: 'diamond',
                                x: -62,
                                symbolFill: '#B5C9DF',
                                hoverSymbolFill: '#779ABF',
                                onclick: function () {
                                    alert('export button');
                                }
                            }
                        }
                }
            });



        });