Date on x-axis of the graph using postgresql data source

I am trying to get the dates in format of YYYY-MM-DD or YYYY-DD-MM which ever one is possible on x-axis. Currently I get time and date in format M/DD MM:SS. In query I have grouped the data by date already.