简体   繁体   English

Highcharts:位置散点图在多系列柱形图中

[英]Highcharts: Position scatter plot in a multi-series column chart

Using Highcharts 3.0: If I have a column chart with multiple series, how can I position a scatter plot on top so that each dot in the scatter plot is placed on top of one certain column, and not just between them? 使用Highcharts 3.0:如果我有一个包含多个系列的柱形图,如何将散点图放在顶部,以便散点图中的每个点都放在某个特定列的顶部,而不仅仅是它们之间? Example jsfiddle here : 示例jsfiddle here

chart: {
     type: "column"   
},
series: [
    {
        data: [1, 2, 3]
    },
    {
        data: [2, 4, 6]
    },
    {
        type: "scatter",
        data: [1,4,3]
    }
]

Could I for instance have the scatter dots (series 3) drawn so that they are visually related to series 1, and not series 2? 例如,我可以绘制散点(系列3),使它们与系列1在视觉上相关,而不是系列2吗?

PS: I would like to be able to relate the scatter plot to the columns on a "per category basis", meaning that I do not only want to be able to consequently shift all the scatter points x pixels to the left/right. PS:我希望能够将散点图与“每个类别”的列相关联,这意味着我不仅希望能够将所有散点x像素向左/右移动。 I would for instance like to be able to relate the first and third scatter dots to series 1, and the second scatter dot to series 2. 例如,我希望能够将第一个和第三个散点图与系列1相关联,并将第二个散点图与系列2相关联。

Is this possible with highcharts? 这可能与highcharts? Hope the question was understandable. 希望这个问题是可以理解的。

The only way I have found to do this is by using decimal values as the x value: 我发现这样做的唯一方法是使用十进制值作为x值:

data: [[-.15,1],[-.15,4],[.15,3]]

example: http://jsfiddle.net/Sas5g/3/ 示例: http//jsfiddle.net/Sas5g/3/

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

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