I've gone through this particular <a href="https://github.com/elastic/kibana/issues/5037" rel="nofollow">ticket</a>, which pretty much talks about adding a threshold line, to a
In my case, I'm having a
bar graph like <a href="https://imgur.com/a/qGxAl" rel="nofollow">this</a> 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
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
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?
Just noticed that this <a href="https://github.com/elastic/kibana/issues/4482" rel="nofollow">issue</a> is still open. Any enhancement over that, or any work around available atm?
Any help could be appreciated. :)Answer1:
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.