diff --git a/models/StatsModel.php b/models/StatsModel.php index e1fd602..5595794 100644 --- a/models/StatsModel.php +++ b/models/StatsModel.php @@ -148,7 +148,7 @@ class StatsModel FROM tickets t WHERE status != 'Closed' AND ($visSQL) GROUP BY priority UNION ALL SELECT 'status' as type, status as label, COUNT(*) as count - FROM tickets t WHERE ($visSQL) GROUP BY status + FROM tickets t WHERE status != 'Closed' AND ($visSQL) GROUP BY status UNION ALL SELECT 'category' as type, category as label, COUNT(*) as count FROM tickets t WHERE status != 'Closed' AND ($visSQL) GROUP BY category"; diff --git a/views/DashboardView.php b/views/DashboardView.php index 4417744..76bc636 100644 --- a/views/DashboardView.php +++ b/views/DashboardView.php @@ -280,8 +280,11 @@ include __DIR__ . '/layout_header.php'; // default: with no `status` param the controller falls back to the viewer's // default_status_filters preference, which can be anything, so the resulting // list would not necessarily match what the chart counted. StatsModel builds - // by_priority and by_category with `status != 'Closed'`, while by_status spans - // every status — so only the priority and category charts pin the open set. + // by_priority, by_status, and by_category all with `status != 'Closed'` — + // closed tickets accumulate indefinitely and would otherwise dominate every + // breakdown over time — so chartPriority/chartCategory pin the open set + // explicitly, while chartStatus's clicked label is itself already one of + // the non-Closed statuses. function openStatuses() { var all = window.TICKET_STATUSES || ['Open', 'Pending', 'In Progress', 'Closed']; return all.filter(function(s) { return s !== 'Closed'; }).join(',');