I have a field of type date and default format insertion_time
I wanted to create a heat map visualization in Kibana 6.5 where I can have and the day_of_month on  x-Axis,  the hour of the day on  y-Axis and  the color represents the count.
So I had to create scripted fields that extract the hour and day_of_month as numbers and store them as sub fields under insertion_time.
The scripts I used are:
doc['insertion_time'].date.dayOfMonth forinsertion_time.day_of_month field and
doc['recording_time'].date.hourOfDay forinsertion_time.hour field
In the visualization settings, for X-axis Aggregation field I chose Terms the field is insertion_time.day_of_month, 31 values and the order is Alphabetical and Descending.
However, whenever I apply a filter or try to split the chart on some fields the order breaks.
My questions are:
- Is there any other way to handle the 
hourandday_of_monthfields as date type? so Kibana can understand the way they should be ordered with? - How can I prevent the visualization from re-ordering the terms on the X and Y axis?
 - Are these issues solved in later versions of Kibana?
 - Is there any better visualization that I can use to show the data distribution I am interested in? Even if this requires installing some other Kibana plugin.
 
Thanks in advance..

