Kibana code

In Kibana when we choose particular visualization and index , how are the column name come to corresponding fields? Where can i find code of particular module?(how column comes in x and y axis)

Ability to customize axis labels is coming in the future - please +1 this Github issue if you think it's important: