How to customize the kibana heatmap by x_coord and y_coord labels

Hi,

yeah that behavior is indeed a bit misleading in the beginning. The reason why the y-axis is sorted other than expected, is these two aggregations are actually done in a nested way, i.e. you first aggregate those x-axis values (which thus have correct sorting) and then within each of the x-axis values, you do the aggregation for the y-axis. That way you will only achieve sorting within each of the x-axis slot, which you can actually also see in the chart, Each section on the y-axis in the following chart separated by lines is sorted in itself.

To achieve the chart you want, you should instead of a terms aggregation, rather use a Histogram aggregation on that field. Switch on Show empty buckets, and just specify the min max value you want for that chart to have. That way the y-axis should be sorted globally the way you want it to be.

Cheers,
Tim