Add footer to charts on highcarts

Im using wpdatatables plugin for wordpress, and im able to add a footer caption to the charts like this fiddle: http://jsfiddle.net/abenrob/ur02w4j5/

This is the code i have:

    Highcharts.setOptions({
  chart: {
    type: 'column',
    events: {
        load: function () {
            var label = this.renderer.label("This text will adjust to chart resizing " +
                "and redraws and will be visible on exported images.")
            .css({
                width: '400px',
                fontSize: '9px'
            })
            .attr({
                'r': 2,
                'padding': 5
            })
            .add();

            label.align(Highcharts.extend(label.getBBox(), {
                align: 'center',
                x: 20, // offset
                verticalAlign: 'bottom',
                y: 0 // offset
            }), null, 'spacingBox');

        }
    },
    marginBottom: 120
},
legend: {
    align: 'center',
    verticalAlign: 'bottom',
    y: -30
},

The thing is that this will add the caption This text will adjust to chart resizing and redraws and will be visible on exported images. to every graph. What i want is to add a footer like that but with a diffrent caption for each graph and make it possible to set it through the backoffice because the person who will use this plugin doesn’t know how to code. Any ideia how i can achieve this?

Read more here: Add footer to charts on highcarts

Leave a Reply

Your email address will not be published. Required fields are marked *