I need to create a line graph for each store in every month of the year. However, store is dynamic it depends on the merchant. This is the return query from the db:
[{"Month":"January","Total":44,"Store":"Refoil"},
{"Month":"January","Total":242,"Store":"Sustainable Salons"},
{"Month":"January","Total":99,"Store":"The Base Collective"},
{"Month":"February","Total":37,"Store":"Refoil"},
{"Month":"February","Total":219,"Store":"Sustainable Salons"},
{"Month":"February","Total":122,"Store":"The Base Collective"},
{"Month":"February","Total":148,"Store":"Watersco Australia"}]
How can I return an object this like:
[{"Month":"January","Refoil":44,"Sustainable Salons":242},
{"Month":"February","Refoil":2,"Sustainable Salons":10}]