You can do that with sort
:
input = { "data_report": [{ "data": [1, 2, 0, 3], "label": "Test2", "backgroundColor": "blue" }, { "data": [3, 4, 2, 5], "label": "test3", "backgroundColor": "#a3eaae" }, { "data": [2, 3, 1, 4], "label": "test4", "backgroundColor": "#37bd11" }, { "data": [1, 2, 0, 3], "label": "test7", "backgroundColor": "#43bee3" }, { "data": [1, 2, 0, 3], "label": "test5", "backgroundColor": "#a3eaae" }, { "data": [0, 1, 0, 2], "label": "test6", "backgroundColor": "#1195bd" }, { "data": [0, 1, 0, 2], "label": "test1", "backgroundColor": "#aeb5b7" }, { "data": [1, 2, 0, 3], "label": "test7", "backgroundColor": "pink" } ], "weeks": ["Week 1 ", "Week 2 ", "Week 3 ", "Week 4 "]};
input.data_report = input.data_report.sort((a,b)=>a.label.match(/d+/)[0]-b.label.match(/d+/)[0]);
console.log(input);