简体   繁体   English

具有相同系列名称的不同数据

[英]Different data with same series name

I am trying to display my data on a bar chart using highcharts. 我正在尝试使用highcharts在条形图上显示我的数据。 It works fine with unique names but when I tried to show different data with same names then it was displaying data on one bar but I want to display it on separate bars. 它可以使用唯一的名称正常工作,但是当我尝试使用相同的名称显示不同的数据时,它会在一个栏中显示数据,但我想将其显示在单独的栏中。 So how can I display data with same names on different bars. 因此,如何在不同的栏中显示具有相同名称的数据。 Here is link of my jsfiddle 这是我的jsfiddle的链接

{
                name: '10100',
                y: 8451720
            },                              {
                name: '10100',
                y: 1456480
            },                              {
                name: '13050',
                y: 187940
            },                              {
                name: '13050',
                y: 6991100
            },                              {
                name: '13050',
                y: 7167320              }]

Thanks 谢谢

From docs: 从文档:

uniqueNames: Boolean uniqueNames:布尔值

When uniqueNames is true, points are placed on the X axis according to their names. 当uniqueNames为true时,将根据其名称将点放置在X轴上。 If the same point name is repeated in the same or another series, the point is placed on the same X position as other points of the same name. 如果在相同或另一个系列中重复相同的点名称,则该点将与相同名称的其他点位于相同的X位置。 When uniqueNames is false, the points are laid out in increasing X positions regardless of their names, and the X axis category will take the name of the last point in each position. 如果uniqueNames为false,则无论点的名称如何,都将按递增的X位置布置点,并且X轴类别将采用每个位置的最后一个点的名称。

So you need to add attribute uniqueNames: false to xAxis 因此,您需要向xAxis添加属性uniqueNames:false

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

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