[Timelion] Integer Divides int does not result in decimal value

This is my expression displaying average user actions.

.es("user:*", metric=cardinality:user).color(#FF0000).label(user),
.es("action:*", metric=sum:actionCount).divide(.es("user:*", metric=cardinality:user)).color(#333300).label(avg action)

When I hover on the graph, the second line's average values are integers. I suspect it is because both cardinality:user and sum:actionCount are integers. I tried to append the second expression with .precision(4) and it, expectedly, does not work.

Can I make it compute decimal results in this case?

Edit: I also tried to .multiply(1.0) before .divide() that fails also.

Hey @michaelcheung,

Is it only the legends that fail to show decimal values, or does the plot show incorrect data too?
You might be running into this issue: https://github.com/elastic/kibana/issues/17379

You are right. It is issue on legends. The curves are fine.

In my opinion, shouldn't it be considered a low priority bug, rather than an enhancement issue?

Yep, I agree this is a bug rather than an enhancement. I can make that change :+1:

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