最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - Highcharts: Change color of bubbles in one serie - Stack Overflow

programmeradmin6浏览0评论

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

This is my jsfiddle: /

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

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

Share Improve this question edited Apr 15, 2013 at 15:50 Lorenzo asked Apr 15, 2013 at 15:12 LorenzoLorenzo 7976 silver badges27 bronze badges
Add a comment  | 

2 Answers 2

Reset to default 9

In your case, you can add the property "fillColor"

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

example: http://jsfiddle.net/tqVF8/17/

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"
    }]

Check out this demo from the site: http://www.highcharts.com/demo/bubble-3d

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

发布评论

评论列表(0)

  1. 暂无评论