Create an interactive analytics dashboard for Agent os aimed at Trades . Include KPI…
- User
Create an interactive analytics dashboard for Agent os aimed at Trades . Include KPI summary cards with trend indicators, a mix of line, bar, and donut charts with hover tooltips and smooth transitions, a sortable and filterable data table, and date-range and segment filters that update every view live. Use a clean, modern visual style with clear layout hierarchy and a dark mode toggle, generate realistic sample data so every chart feels alive, and make it fully responsive.
Assistant
I'll build a comprehensive analytics dashboard for Agent OS. Let me start by exploring the project and setting up dependencies.
Great. Let me install the required packages and start building.
Now let me create all the files. I'll start with the data layer and utilities, then components.
Now the data table component:
Now the main App component that ties everything together:
Now update the title and add animations to the CSS:
Now let's build the project to verify everything compiles:
The build succeeds ✅. Let me verify the final file structure:
The Agent OS Trade Analytics Dashboard is fully built and ready. Here's what's included:
🎯 Dashboard Features
📊 KPI Summary Cards (6 cards)
- Total P&L, Win Rate, Total Trades, Total Volume, Avg P&L/Trade, Total Fees
- Each card shows: current value + percentage change vs prior period + directional trend arrow (up/down/neutral)
- Smooth animated number transitions when filtering
📈 Charts (4 interactive charts)
Chart Type Description P&L Over Time Area chart (gradient fill) Daily profit/loss trend over 90 days Segment Distribution Donut chart Trade distribution across Equities, Futures, Options, Forex, Crypto Top Instruments by P&L Horizontal bar chart Best & worst performing instruments (green/red bars) Daily Activity Dual-axis line chart Trade count + win rate % over time - Hover tooltips with styled popups on all charts
- Smooth animations (800ms ease-out transitions via Recharts)
📋 Data Table
- 10 columns: Date, Segment, Instrument, Trades, Volume, P&L, Win Rate, Avg Hold, Fees, Status
- Sortable — click any column header, toggles asc/desc with visual indicator
- Filterable — search by instrument name, filter by trade status (Win/Loss/Breakeven)
- Pagination — 15 rows per page with smart page navigation
- Color-coded P&L (green/red) and status badges
🎛️ Filters (all update every view live)
- Date presets: Last 7 / 30 / 60 / 90 days + Custom date range picker
- Segment filter: Multi-select dropdown with Select All/Deselect All
- Status filter in table: All / Wins / Losses / Breakeven
🌙 Dark Mode
- Toggle in header with Sun/Moon icon
- Persists to
localStorage - Respects system
prefers-color-schemeon first visit - Smooth
color-schemetransitions throughout
📱 Responsive Design
- Grid layouts adapt: 6 columns → 3 → 2 on mobile
- Table horizontally scrollable on small screens
- Filters collapse/stack gracefully
- Header adapts from row to column layout
🧪 Data
- 90 days of realistic seeded-random trade data across 5 segments and 22 instruments
- All KPIs, aggregations, and filters computed reactively with
useMemo
Files built:
src/data/sampleData.ts,src/hooks/useDarkMode.ts,src/components/Header.tsx,src/components/KPICards.tsx,src/components/ChartsSection.tsx,src/components/DataTable.tsx,src/App.tsx,index.html,src/index.css