mirror of
https://git.mirrors.martin98.com/https://github.com/SigNoz/signoz
synced 2025-08-15 21:05:52 +08:00
fix: add null check for allDataPoints in chart data processing
This commit is contained in:
parent
229922a529
commit
aaabd0f904
@ -30,14 +30,15 @@ export const getChartData = (
|
|||||||
};
|
};
|
||||||
const chartLabels: ChartData<'line'>['labels'] = [];
|
const chartLabels: ChartData<'line'>['labels'] = [];
|
||||||
|
|
||||||
Object.keys(allDataPoints).forEach((timestamp) => {
|
if (allDataPoints)
|
||||||
const key = allDataPoints[timestamp];
|
Object.keys(allDataPoints).forEach((timestamp) => {
|
||||||
if (key.value) {
|
const key = allDataPoints[timestamp];
|
||||||
chartDataset.data.push(key.value);
|
if (key.value) {
|
||||||
const date = dayjs(key.timestamp / 1000000);
|
chartDataset.data.push(key.value);
|
||||||
chartLabels.push(date.toDate().getTime());
|
const date = dayjs(key.timestamp / 1000000);
|
||||||
}
|
chartLabels.push(date.toDate().getTime());
|
||||||
});
|
}
|
||||||
|
});
|
||||||
|
|
||||||
return {
|
return {
|
||||||
datasets: [
|
datasets: [
|
||||||
|
Loading…
x
Reference in New Issue
Block a user