简体   繁体   English

高图散点图集标记

[英]Highcharts scatter set markers

How can I specify the marker shape per population in a Highchart scatter plot? 如何在Highchart散点图中指定每个人口的标记形状? It seems to me that they are selected randomly or from a list ? 在我看来,它们是随机选择还是从列表中选择?

They may be selected randomly by default, but to set them explicitly, try something like this: 默认情况下,它们可能是随机选择的,但是要明确设置它们,请尝试如下操作:

series: [{
    name: 'Predefined symbol',
    data: [316.4, 294.1, 195.6, 154.4],
    marker: {
        symbol: 'triangle'
    }
}],

Where the symbol attribute can specify a shape or link to an icon. 其中symbol属性可以指定形状或链接到图标。 There are some pretty cool other options such as creating a custom shape with the following code: 还有一些很酷的其他选项,例如使用以下代码创建自定义形状:

// Define a custom symbol path
Highcharts.SVGRenderer.prototype.symbols.cross = function (x, y, w, h) {
    return ['M', x, y, 'L', x + w, y + h, 'M', x + w, y, 'L', x, y + h, 'z'];
};
if (Highcharts.VMLRenderer) {
    Highcharts.VMLRenderer.prototype.symbols.cross = Highcharts.SVGRenderer.prototype.symbols.cross;
}

Here's a link to the highcharts documentation on this subject: 这是有关此主题的highcharts文档的链接:

http://api.highcharts.com/highcharts#plotOptions.scatter.marker.symbol http://api.highcharts.com/highcharts#plotOptions.scatter.marker.symbol

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM