Grafana with mysql show weekly result


I am trying to show result weekly in x-axis for that i changed format in graph.js file in time_format function with “%u” but it’s not working for me.

I am working on grafana 5.1.

For now i am getting the result in dd/mm/yyyy format. Below is the query i am using now

UNIX_TIMESTAMP(STR_TO_DATE(Created, ‘%m/%d/%Y’)) as time_sec,
Total_Cycles as value,
Type as metric
FROM cam where Date_Range != ‘2016 - 2017’ and Date_Range != ‘2017 - 2018’ and Date_Range != ‘2018 - 2019’

Do i need to change the query or i need to change the code some where.

You need to group group data by week in your query. Not a MySQL expert so can’t help you with that.