I'm getting some information from my database and holding that information in an array. I've used {{dump(weights)}} in my twig template, see below the dump of the array:

If i use weights|json_encode() I can get this information:

Which is okay, but my graph needs the data in a format like this - [69,72].
For example, this is how the code should look for the graph:
var geckoWeight = {
labels: dates,
datasets: [
{
label: "Front",
fillColor: "rgba(0, 0, 0, 0.15)",
strokeColor: gradient,
pointColor: gradient,
pointStrokeColor: "#202b33",
pointHighlightStroke: "rgba(225,225,225,0.9)",
data: [69,72]
}
]
};
What is the best way to manipulate my data to suit what is needed in the graph data?