ElementStacks

by Anand Rathod

HTML

<script src="http://highcharts.com/js/testing.js"></script>
<script src="http://code.highcharts.com/highcharts.js"></script>
<script src="https://raw.github.com/briancray/tooltipsy/master/tooltipsy.min.js"></script>
<div id="container" style="height: 400px"></div>

CSS

.hastip {
    cursor: pointer;
}

JavaScript

function someEvent(text) {
    console.log(text);

}

var chart = new Highcharts.Chart({
    chart: {
        renderTo: 'container',
        marginRight: 80 // like left
    },
    xAxis: {

        categories: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'],
        labels: {
            useHTML: true,
            formatter: function () {
                console.log(this);
                return '<div class="hastip" title="' + this.value + ' MY TOOOLTIP">' + this.value + '</div>';
            }
        }
    },
    yAxis: [{
        lineWidth: 1,
        title: {
            text: 'Secondary Axis'
        }
    }],

    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]
    }]
}, function (chart) {
    $('.hastip').tooltipsy();
    console.log(chart.xAxis[0]);
});