我正在尝试实现类似下图的内容。我想要两件事:
1:背景颜色到某个值(对于这个例子0,5)应该有不同的颜色 2:超出该标记的任何东西都应该是不同的颜色。
这可能吗?
到目前为止我所拥有的是非常基本的: http://jsfiddle.net/t21m44tv/
backgroundColor: {
stops: [
[0, 'rgb(245, 245, 245)'],
[1, 'rgb(245, 245, 245)']
]
},
答案 0 :(得分:1)
您可以使用yAxis plotBands将背景颜色添加到特定值:
(tcp-server {:host "127.0.0.1" :port 5555})
(let [userindex1 (default :ttl 300 (update-index (index)))])
(let [email (mailer {....email configuration})]
(streams
(where (service "log")
(smap
(fn [events]
(let [count-of-transaction (count (filter #(= "error" (:type %)) events))]
(event
{
:status "Failure"
:metric count-of-failures
:total-fail (< count-of-failures 2)})))
(where (let [now (clj-time.core/now)]
(and (<= 3 (clj-time.core/hour now) 20)
(= (:status event) "Failure")
(:total-fail event)))
(rollup 1 200
(email "xxx@xx.com")
))prn))))
您可以根据点的值使用区域来更改系列的颜色:
yAxis: {
title: {
text: ''
},
plotLines: [{
value: 0,
width: 0,
color: '#808080'
}],
plotBands: [{
from: 0,
to: 0.5,
color: 'rgba(230,120,50,0.2)',
zIndex: 5
}]
},
在这里您可以找到一个如何工作的示例: http://jsfiddle.net/t21m44tv/2/