Highchart columnrange,基于数据的颜色代码行

时间:2014-03-21 05:58:46

标签: highcharts

是否可以使用" GROUP"对高亮度列范围内的代码条进行着色。 json示例数据中的数组如下所示?所以如果它的" IT"它会说绿色," Sierra"红色。任何帮助都会非常感激。谢谢。

{
    "name": "PW (md.h24mi)",
        "data": [
        [320, 320.06],
        [319.05, 319.1],
        [319.05, 319.1],
        [319.05, 319.1],
        [319.05, 319.1],
        [319.05, 319.1],
        [319.05, 319.1],
        [319.05, 319.1],
        [319.05, 319.1],
        [319.05, 319.1],
        [319.05, 319.1],
        [320, 320.04]
    ],
        "PW": [
        ["PW0000025090"],
        ["PW0000025158"],
        ["PW0000025160"],
        ["PW0000025171"],
        ["PW0000025172"],
        ["PW0000025161"],
        ["PW0000025173"],
        ["PW0000025159"],
        ["PW0000025164"],
        ["PW0000025170"],
        ["PW0000024827"],
        ["PW0000024461"]
    ],
        "GROUP": [
        ["IT"],
        ["Sierra"],
        ["Sierra"],
        ["RF Engineers"],
        ["RF Engineers"],
        ["Sierra"],
        ["RF Engineers"],
        ["Sierra"],
        ["RF Engineers"],
        ["RF Engineers"],
        ["Sierra"],
        ["IP"]
    ],
        "worksum": [
        ["Call Back Assist (CBA) Modification"],
        ["TMA Installation"],
        ["TMA Installation"],
        ["TMA Installation"],
        ["TMA Installation"],
        ["TMA Installation"],
        ["TMA Installation"],
        ["TMA Installation"],
        ["TMA Installation"],
        ["TMA Installation"],
        ["TMA Installation"],
        ["Upgrade Consumer Wimax Firewall Modules to R77.10"]
    ]
}

2 个答案:

答案 0 :(得分:0)

不幸的是,这是不可能的,但您可以尝试按parameter

设置颜色

答案 1 :(得分:0)

很容易将这些东西组合到主数据阵列中......

例如:

{
  "name": "PW (md.h24mi)",
  "data": [
     { low:320   , high:320.06, PW:"PW0000025090", GROUP:"IT",           color:'green' },
     { low:319.05, high:319.1,  PW:"PW0000025158", GROUP:"Sierra",       color:'red'   },
     { low:319.05, high:319.1,  PW:"PW0000025160", GROUP:"RF Engineers", color:'blue'  }
  ]
}

然后,您可以检索工具提示或标签格式器中的任何/所有值以显示在图表上,或用于确定其他属性。

{{edit - 已更新以反映列范围系列类型的数据格式。

小提琴:

http://jsfiddle.net/jlbriggs/tAc6Z/