Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Highcharts loading image

Tags:

highcharts

Using http://api.highcharts.com/highcharts#loading

Is it possible to have an image as part of the overlay that is shown? specifically a "loading" gif image?

I've tried using the labelStyle section, but no luck so far!

like image 778
sbozzie Avatar asked Feb 17 '23 15:02

sbozzie


1 Answers

After examining the API. This does seem to be possible.

labelStyle accepts any valid CSS. Properties that are normally hyphenated remove the hyphen, and capitalize the next letter. This means we can use something like background-image to supply a background image (like a loading .gif).

var chart = new Highcharts.Chart({
    // ...

    loading: {
        labelStyle: {
            backgroundImage: 'url("http://jsfiddle.net/img/logo.png")',
            display: 'block',
            width: '136px',
            height: '26px',
            backgroundColor: '#000'
        }
    },

    // ...
});

Example fiddle here.

like image 112
NT3RP Avatar answered Feb 28 '23 12:02

NT3RP