Heat map y-axis sort order

Hi,

I'm trying to plot a KPI distribution over days of the week (x-axis) and hour of day (y-axis). I got it all together using 2 histogram splits, but I can't find a way to sort the y-axis by axis value. The values are mostly sorted, but with a weird break in it (7 and 8 after 22).

Both fields are number fields. The x-axis field is a "proper" field while the y-axis field is a scripted field. Could this be the issue?

Cheers,
Simon

What does the script for your scripted field look like?

This is the script:

def scheduled_drop_off_time_from = doc['scheduled_drop_off_time_from'].value.getMillis();

def cal = Calendar.getInstance();
cal.setTime(new Date(scheduled_drop_off_time_from));
return cal.get(Calendar.HOUR_OF_DAY);

It might be related to time zones? Elasticsearch assumes utc for date fields, but the scripted fields may pick up the time zone of the server. Maybe you could try setting the time zone to UTC in your scripted field and see if that fixes things for you.

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