π:1
Assuming that you want a single dataset, you need a single array (not two). So change to :
foreach ($result as $row) {
$revenue_value[] = [
'x' => $row["month"],
'y' => $row["revenue"]
];
}
Then in your javascript βdataβ variable, remove the square brackets :
const data = {
datasets: [{
label: 'Revenue value:',
backgroundColor: '#20e0307a',
borderColor: '#04aa1a',
data: <?= json_encode($revenue_value) ?>,
borderWidth: 1,
}]
};