livewire-charts
livewire-charts copied to clipboard
multiline chart mode am i using it correctly?
$multiLineChartModel = $aggregatedData->reduce(
function ($chartModel, $data) {
// Assuming $data->date_interval is your column category (x-axis)
$chartModel->addSeriesPoint('Notified Users', $data->date_interval, $data->total_sent);
$chartModel->addSeriesPoint('Opted-Out Users', $data->date_interval, $data->total_not_sent);
$chartModel->addSeriesPoint('Clicks', $data->date_interval, $data->total_open_count);
return $chartModel;
},
LivewireCharts::multiLineChartModel()
->setTitle('Notification Stats')
->setAnimated(true)
->setDataLabelsEnabled(true)
->withOnPointClickEvent('onPointClick')
->setSmoothCurve()
->multiLine()
->setColors(['#15803d', '#b91c1c', '#1d4ed8']) // Set your colors accordingly
);
i don't understand as to why the line is off. jan'24 blue line should have been in 5 but instead it is in 20, same as the red line..
It looks like your issue might be related to the data points not aligning correctly with your x-axis labels. Ensure that the $data->date_interval values are consistent and correctly formatted. Additionally, verify that the addSeriesPoint method is receiving the expected data.