How can I apply a threshold for a bar graph in Kibana?

我只是一个虾纸丫 提交于 2019-12-12 00:37:51

问题


I've gone through this particular ticket, which pretty much talks about adding a threshold line, to a line graph.

In my case, I'm having a bar graph like this where I need to have a threshold, lets say for example in the above graph itself I should be able to show the difference in each and every bar.

In other words as per the above graph, it's displaying the sum of chargeamount according to the filter I've given. What I need to do is, to show the difference using a color in the same bar itself if the sum of chargeamount is greater than 50,000.

So is there a way that I can show the bar with the default color for the filter (ie: the ones which are less than 50,000) and the rest should be shown in a different color conveying the threshold. So that the user can see the difference in the bar itself, whether they've achieved more than 50k.

Is this possible using a bar graph or should I be get going with some other graph?

EDIT:

Just noticed that this issue is still open. Any enhancement over that, or any work around available atm?

Any help could be appreciated. :)


回答1:


Timelion to the rescue! Altough haven't figured out stacking something like this could work for now:

.es(*).if(gt,100,.es(*),null).bars().color(red) .es(*).if(lte,100,.es(*),null).bars().color(blue) .static(100)

Here is what it does:

1.Get every datapoint with a value greater than 100 and null everything else. Make a bar graph with color red.

2.Get every datapoint with a value less than equal 100 and null everything else. Make a bar graph and color it red.

3.Finally draw a line at value 100.

What you need to do is replace the * with a valid expression and you should be good to go!

There might be a way to subtract the value and add it on another graph but I haven't figured out how to do that. If I find a solution I will update this answer.



来源:https://stackoverflow.com/questions/41478503/how-can-i-apply-a-threshold-for-a-bar-graph-in-kibana

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!