Charts: Implement heatmap sort for sparse data