I have a visualization which can visualize term deposits (TD) of a bank. (Aka Fixed deposit). The maturity date of a TD account falls into one of the following buckets:

```
"7 days to 14 days"
"15 days to 29 days"
"30 days to 45 days"
"46 days to 60 days"
"61 days to 184 days"
"185 days to 289 days"
"290 days to 364 days"
"390 days to 17 months 29 days"
"18 months to 2 years"
"2 years 1 day to 3 years"
"3 years 1 day to 5 years"
"5 years 1 day to 10 years"
```

I cannot maintain the above order in the visualization.

For e.g. the maturity date in the log data may be specified as month, days, or both. For e.g. 734 days translates to 2 years and 2 days, thus it falls into the **2 years 1 day to 3 years** bucket.

I have a ruby filter in logstash which runs custom ruby code and assigns the bucket.

However, in kibana when I try to visualize the total TD amounts (i.e cumulative sum) against a bucket, its order is jumbled...

Any strategy to fix this?