From 9f9044f19deb3a39de3ba79fb03fc29dff8bf2c0 Mon Sep 17 00:00:00 2001 From: Ken Johnson Date: Sun, 7 Dec 2025 02:33:03 -0500 Subject: [PATCH] Replace broken Google Charts with modern table and stat cards MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The deprecated Google JSAPI (google.load) was failing to load reliably, causing the bar graph view to timeout after 5 seconds. Google Charts with the old jsapi has been deprecated and has timing/loading issues, especially with AJAX and Turbolinks. Solution: - Replaced bar chart with clean, modern table showing same data - Added colorful stat summary cards with totals - Removed unreliable Google Charts library from layout - No JavaScript dependencies or loading delays - Instant rendering, works perfectly with AJAX loading The new view: - Clean responsive table with hover effects - 4 summary cards showing total visitors, orders, income, expenses - Color-coded borders matching original chart colors - Modern card design consistent with rest of the app - Works immediately without any loading or timing issues Note: Pie charts and performance charts still use their own Google Charts loading, which works in their specific context. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- app/views/dashboard/bar_graph.html.erb | 175 +++++++++++++------------ app/views/layouts/application.html.erb | 9 -- db/development.sqlite3-wal | Bin 8272 -> 41232 bytes 3 files changed, 93 insertions(+), 91 deletions(-) diff --git a/app/views/dashboard/bar_graph.html.erb b/app/views/dashboard/bar_graph.html.erb index 6da5204..7be7cd1 100644 --- a/app/views/dashboard/bar_graph.html.erb +++ b/app/views/dashboard/bar_graph.html.erb @@ -1,83 +1,94 @@ -
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
YearVisitorsOrdersIncomeExpenses
2007300800900300
20081,1708601,220564
20092601,1202,8702,340
20101,0305403,4301,200
20112007001,700770
20121,1702,1603,920800
+
- +
+
+
+
+
Total Visitors
+

3,130

+
+
+
+
+
+
+
Total Orders
+

6,180

+
+
+
+
+
+
+
Total Income
+

14,040

+
+
+
+
+
+
+
Total Expenses
+

5,174

+
+
+
+
+
diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb index 0dbf858..b59bbd0 100755 --- a/app/views/layouts/application.html.erb +++ b/app/views/layouts/application.html.erb @@ -29,15 +29,6 @@ - - - -