Highcharts loading image [英] Highcharts loading image

查看:129
本文介绍了Highcharts loading image的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用 http://api.highcharts.com/highcharts#loading

是否可以将图像作为显示的叠加层的一部分?特别是一个加载gif图像?

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

我尝试过使用labelStyle部分,但至今没有运气!

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

推荐答案

检查API后。这似乎是可能的。

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

labelStyle 接受任何有效的CSS。通常连字符的属性删除连字符,并大写下一个字母。这意味着我们可以使用 background-image 之类的东西来提供一个背景图片(比如加载 .gif )。

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'
        }
    },

    // ...
});

示例小提琴

这篇关于Highcharts loading image的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆