Different marker sizes in highcharts?

不羁的心 提交于 2019-12-04 04:56:26

问题


For my scatter chart in highcharts I would like different series to have different marker radius. Is this possible?

"plotOptions": {"series": {"marker": {"enabled": true
                                     ,"symbol": "circle"
                                     ,"radius": 15}
                                     }
                           }
                {

It does not work to use:

    "plotOptions": {"series": {"marker": {"enabled": true
                                     ,"symbol": "circle"
                                     ,"radius": 15,20,10,5,2}
                                     }
                           }
                {

回答1:


You can provide marker option for radius in each individual data series So series will be as

        series: [{
        name: 'Female',
        color: 'rgba(223, 83, 83, .5)',
        data: [[161.2, 51.6], [167.5, 59.0], [159.5, 49.2], [157.0, 63.0], [155.8, 53.6],
            [170.0, 59.0], [159.1, 47.6], [166.0, 69.8], [176.2, 66.8], [160.2, 75.2],
            [172.5, 55.2], [170.9, 54.2], [172.9, 62.5], [153.4, 42.0], [160.0, 50.0]
            ],
            marker: {
            radius: 10
        },

    }, {
        name: 'Male',
        color: 'rgba(119, 152, 191, .5)',
        data: [[174.0, 65.6], [175.3, 71.8], [193.5, 80.7], [186.5, 72.6], [187.2, 78.8],
            [181.5, 74.8], [184.0, 86.4], [184.5, 78.4], [175.0, 62.0], [184.0, 81.6],
            [180.0, 76.6], [177.8, 83.6], [192.0, 90.0], [176.0, 74.6], [174.0, 71.0]
  ],

            marker: {
            radius: 20
        },
    }]

Hope this help Fiddle Link




回答2:


You have to set a marker for each serie. So you have to do something like this.

...
series: [{
    name: 'Serie 1',
    data: ...
    marker: {
        enabled: true,
        symbol: "circle",
        radius: 5
    }
},{
    name: 'Serie 2',
    data: ...
    marker: {
        enabled: true,
        symbol: "circle",
        radius: 10
    }
},{
    name: 'Serie 3',
    data: ...
    marker: {
        enabled: true,
        symbol: "circle",
        radius: 15
    }
}]

I hope this helps :)



来源:https://stackoverflow.com/questions/41870308/different-marker-sizes-in-highcharts

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!