1

我的堆积条形图有这个问题。
它没有正确堆叠。

请参考红色箭头所指的栏。
当我尝试单击下栏时,会选择上栏。

堆积条形图

请你帮助我好吗?

以下是我的数据集:

[ { "bars" : { "barWidth" : 20000, "fill" : true, "lineWidth" : 0, "order" : 1, "show" : true }, "data" : [ [ 50000, 0 ], [ 150000, 0], [250000, 0], [350000, 0], [450000, 0], [550000, 0], [650000, 0], [750000, 0], [850000, 0], [950000, 0 , [ 1050000, 0 ], [ 1150000, 0 ], [ 1250000, 0 ], [ 1350000,0 ], [ 1450000, 0 ], [ 1550000, 0 ], [ 1650000, 0 ], [ 1750000, 0 ], [ 1850000, 0 ], [ 1950000, 0 ], [ 2050000, 0 ], [ 2150000, 0 ] , [ 2250000, 0 ], [ 2350000, 0 ], [ 2450000, 0 ], [ 2550000, 0 ], [ 2650000, 0 ], [ 2750000, 0 ], [ 2850000, 0 ], [ 2950000, 0 ], [ 3050000, 0],[3150000, 0], [3250000, 0], [3350000, 0], [3450000, 0], [3550000, 0], [3650000, 0], [3750000, 0], [3850000, 0], [3950 , 0 ], [ 4050000, 0 ], [ 4150000, 0 ], [ 4250000, 0 ], [ 4350000, 0 ], [ 4450000, 0 ], [ 4550000, 0 ], [ 4650000, 0 ], [ 4750000, 0 ], [ 4850000,0],[4950000, 0],[5050000, 0],[5150000, 0]],“堆栈”:true,“xaxis”:1 },{“bars”:{“barWidth”:20000,“填充” :真,“线宽”:1,“订单”:2,“显示”:真},“颜色”:“#0066FF”,“数据”:[[50000,35],[150000,41],[250000 , 40 ], [ 350000, 45 ], [ 450000, 50 ], [ 550000, 55 ], [ 650000, 1 ],[750000, 2], [850000, 70], [950000, 4], [1050000, 5], [1150000, 6], [1250000, 7], [1350000, 8], [1450000, 9], [155000 , 10 ], [ 1650000, 11 ], [ 1750000, 12 ], [ 1850000, 13 ], [ 1950000, 15 ], [ 2050000, 30 ], [ 2150000, 29 ], [ 2250000, 0, 28 ], [ 2350 ], [ 2450000,26]、[2550000、24]、[2650000、24]、[2750000、23]、[2850000、22]、[2950000、21]、[3050000、20]、[3150000、19]、[3250000] , [ 3350000, 17 ], [ 3450000, 16 ] ], "label" : "Fruits", "stack" : true, "xaxis" : 1 }, { "bars" : { "barWidth" : 20000, "fill" :真,“线宽”:1,“订单”:3,“显示”:真},“颜色”:“#93CDDD”、“数据”:[[150000、65]、[750000、32]]、“标签”:“蔬菜”、“堆栈”:真、“xaxis”:1}、{“条形图” " : { "barWidth" : 20000, "fill" : true, "lineWidth" : 1, "order" : 4, "show" : true }, "color" : "#0066FF", "data" : [ [ 450000 , 100 ], [ 950000, 50 ], [ 1450000, 114 ], [ 1550000, 6 ], [ 1750000, 44 ], [ 1850000, 71 ], [ 2550000,2],[2850000, 71],[2950000, 35],[3250000, 99]],“标签”:“动物”,“堆栈”:真,“xaxis”:1}]

4

1 回答 1

1

这看起来像是堆叠插件中的错误。

您的“水果”和“动物”系列之间的“蔬菜”系列在该位置没有栏(450000)。它导致插件不堆叠“水果”和“动物”系列,而是覆盖它们。在该位置向“蔬菜”系列添加一个0栏可解决此问题:

{
    "bars": {
      "barWidth": 20000,
      "fill": true,
      "lineWidth": 1,
      "order": 3,
      "show": true
    },
    "color": "green",
    "data": [
      [150000, 65],
      [450000, 0], // ADDED THIS POINT
      [750000, 32]
    ],
    "label": "Vegetables",
    "stack": true,
    "xaxis": 1
  }

这是一个固定的例子。我更改了颜色以更好地可视化正在发生的事情。

于 2014-08-30T15:49:40.877 回答