Unstacked bar charts for 3 concurrent different date fields

Hi, I'm trying to plot two different counts of date value fields (register_date and conclusion_date) and a third which should be calculated (should be the cummulative sum of registered docs - the cumulative sum of concluded. Also having trouble calculating it).

Using the traditional Vertical Bar visualization I found no way to plot both date fields witout aggregating one within the other (ie: only show the register_date per conclusion_date or vice-versa) - I believe it would be possible if I could open more than one X-Axis, but ideally I'd like to plot both on the same "neutral" time axis.

I tried it in timelion, and in the visual builder as well, which do plot both counts independently. However both don't seem to be able to plot the bars unstacked. I've scoured the docs and didn't find how to do that.

Regarding the third field, I managed the cummulative sum of registered docs easily using the cummulative sum metric, but I'm not quite sure how to subtract the cummulative sum of concluded docs.

Any help would be appreciated. Thank you.

With timelion, you could use .bars(stack=false) to unstack the bars. e.g.

.es(index=my_dates, timefield=register_date).bars(width=30, stack=false), .es(index=my_dates, timefield=conclusion_date).bars(width=10, stack=false)

Timelion also has mathematical functions that might help with the third field (ex. subtract()).

Thanks for the mathematical functions link. I figured there might be something but had trouble finding it.

I had tried the stack=false in timelion before, but it always draws the bars behind one another instead of beside one another. That's the same behaviour exhibited by the Visual Builder by the way. Any way to change that?

Maybe you can change the bars.width or offset the series?


Thanks a lot for the tip. I had actually played before with those values and gave it another shot, but it really doesn't fix the issue, since offset will throw the data at the wrong bucket (as it should).

I "fixed it" by using different widths for different data (making it show behind) and reorienting the concluded cases as negatives, which turned out quite nice. Unfortunately this is not ideal for other use cases and therefore I'm still on the hunt for a better solution.

Another issue, which I raised regarding the standard vertical bar visualization, is that I believe there should be just one label per bucket when timelion (or the vertical bars for that matter) simply choose a number of labels based on the chart width and repeats the label. It looks confusing (and dare I say kind of ugly) to say the least. Do you know of any way to fix the number of buckets shown? Perharps that would fix it.

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.