Clean up balance chart.

This commit is contained in:
James Cole
2024-05-20 07:30:41 +02:00
parent bcb672920c
commit 3eaaac09ad
7 changed files with 302 additions and 204 deletions

View File

@@ -57,14 +57,11 @@ class ChartData
if (array_key_exists('native_currency_id', $data)) {
$data['native_currency_id'] = (string) $data['native_currency_id'];
}
if (!array_key_exists('start', $data)) {
throw new FireflyException('Data-set is missing the "start"-variable.');
}
if (!array_key_exists('end', $data)) {
throw new FireflyException('Data-set is missing the "end"-variable.');
}
if (!array_key_exists('period', $data)) {
throw new FireflyException('Data-set is missing the "period"-variable.');
$required = ['start', 'date', 'end', 'entries', 'native_entries'];
foreach ($required as $field) {
if (!array_key_exists($field, $data)) {
throw new FireflyException(sprintf('Data-set is missing the "%s"-variable.', $field));
}
}
$this->series[] = $data;