Skip to content
Snippets Groups Projects
Commit 8057b96c authored by Florian's avatar Florian
Browse files

chart direction

parent d5d6827a
Branches main
No related tags found
No related merge requests found
......@@ -286,6 +286,8 @@ class _DetailsViewState extends State<DetailsView> {
List<LineChartBarData> buildBarData(List<Transaction> transactionsList) {
List<LineChartBarData> categoryBars = [];
List<Category> selectedCategories = [];
List<Transaction> barDataList = transactionsList.toList();
barDataList.sort((a, b) => a.createdAt.compareTo(b.createdAt));
for (String categoryId in appState.detailsTransactionsFilter) {
if (locator
.get<CategoriesController>()
......@@ -299,7 +301,7 @@ class _DetailsViewState extends State<DetailsView> {
in locator.get<CategoriesController>().categories.values) {
List<FlSpot> categoryDataPoints = [const FlSpot(0.0, 0.0)];
int xVal = 1;
for (Transaction transaction in transactionsList) {
for (Transaction transaction in barDataList) {
if (transaction.categoryId == category.id) {
categoryDataPoints
.add(FlSpot(xVal.toDouble(), transaction.amount.abs()));
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment