Fixed price history chart data parsing (fixes #1914)

This commit is contained in:
Bernd Bestel
2022-06-09 22:14:00 +02:00
parent 48e9467a99
commit fe92caaed4
2 changed files with 3 additions and 1 deletions

View File

@@ -151,7 +151,7 @@ Grocy.Components.ProductCard.Refresh = function(productId)
datasets[key] = []
}
chart.labels.push(moment(dataPoint.date).toDate());
datasets[key].push(Number.parseFloat(dataPoint.price) * Number.parseFloat(productDetails.product.qu_factor_purchase_to_stock));
datasets[key].push({ x: moment(dataPoint.date).toDate(), y: Number.parseFloat(dataPoint.price) * Number.parseFloat(productDetails.product.qu_factor_purchase_to_stock) });
});
Object.keys(datasets).forEach((key) =>
@@ -163,6 +163,7 @@ Grocy.Components.ProductCard.Refresh = function(productId)
label: key,
});
});
Grocy.Components.ProductCard.PriceHistoryChart.update();
}
else