Highcharts:改变一个系列中气泡的颜色 [英] Highcharts: Change color of bubbles in one serie

查看:299
本文介绍了Highcharts:改变一个系列中气泡的颜色的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我可以在气泡图中为一个系列设置不同的颜色吗?

Can I set different colors for a serie in a bubble chart? I try setting the property "color" but not work.

        data: [{
            x: 23,
            y: 22,
            z: 200,
            name:"point1",
            color: 'red'
        }, {
            x: 43,
            y: 12,
            z: 100,
            name:"point2",
            color:'yellow'
        }]

也许我可以在系列中使用一个标签,但我更喜欢改变泡泡,这有可能吗?

Maybe I can use a label in the serie but I prefer the change the bubble, it is possible?

dataLabels: {
      enabled: true,
      color: 'red'
}

这是我的jsfiddle: http://jsfiddle.net/tqVF8/ 2 /

This is my jsfiddle: http://jsfiddle.net/tqVF8/2/

推荐答案

需要独特颜色的每个点都需要自己的系列对象。这有点奇怪,但这是有效的:

Each point that needs a unique color will need its own series object. It's a little weird, but this works:

    series: [{
        data: [{
            x: 23,
            y: 22,
            z: 200,
            name:"point1"
        }, {
            x: 43,
            y: 12,
            z: 100,
            name:"point2",
        }],
        color: "yellow"
    },{
        data: [{
            x: 50,
            y: 22,
            z: 150,
            name:"point3"
        }, {
            x: 43,
            y: -30,
            z: 100,
            name:"point4",
        }],
        color: "blue"
    }]

查看该网站的演示: http ://www.highcharts.com/demo/bubble-3d

以下是一个以您的示例为例的小提琴:
http://jsfiddle.net/Robodude/tqVF8/7/

And here is a js fiddle with your example: http://jsfiddle.net/Robodude/tqVF8/7/

这篇关于Highcharts:改变一个系列中气泡的颜色的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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