Skip to content

Latest commit

 

History

History
executable file
·
135 lines (101 loc) · 4.38 KB

File metadata and controls

executable file
·
135 lines (101 loc) · 4.38 KB

Platform Comparison Charts

This document describes the new platform comparison charts added to the main page of the CryptoTrading application.

Overview

New comparison charts have been added below the existing charts to provide comprehensive data comparison between different cryptocurrency data sources:

  • LiveCoinWatch
  • CoinGecko
  • CoinMarketCal
  • CryptoCompare

New Charts Added

1. Platform Data Comparison Chart

  • Type: Bar Chart
  • Purpose: Compares total coins, market cap, and volume across all platforms
  • Data: Shows three metrics for each platform side by side

2. Market Cap Comparison Chart

  • Type: Doughnut Chart
  • Purpose: Visualizes market cap distribution by platform
  • Data: Shows relative market cap percentages for each platform

3. Volume Comparison Chart

  • Type: Pie Chart
  • Purpose: Displays volume distribution across platforms
  • Data: Shows relative trading volume percentages

4. Coin Count Comparison Chart

  • Type: Bar Chart
  • Purpose: Compares the number of coins tracked by each platform
  • Data: Simple count comparison

5. Price Movement Comparison Chart

  • Type: Bar Chart
  • Purpose: Analyzes gaining vs losing coins by platform
  • Data: Shows positive and negative price movements

6. Platform Performance Summary Table

  • Type: Data Table
  • Purpose: Comprehensive overview of all platform metrics
  • Columns: Platform, Total Coins, Market Cap, Volume, Gaining Coins, Losing Coins, Last Updated

Data Sources

The charts pull data from the following database tables:

LiveCoinWatch

  • live_coin_watches - Main coin data
  • fiats - Fiat currency data
  • exchanges - Exchange information

CoinGecko

  • coin_gecko_coins - Coin information
  • coin_gecko_markets - Market data
  • coingecko_exchanges - Exchange data
  • coin_gecko_trendings - Trending coins

CoinMarketCal

  • coinmarketcals - Calendar events
  • events - Event details

CryptoCompare

  • crypto_compare_coins - Coin data
  • crypto_compare_markets - Market information
  • crypto_compare_exchanges - Exchange data
  • crypto_compare_news - News articles
  • crypto_compare_top_pairs - Top trading pairs

Technical Implementation

Frontend

  • Charts: Built using Chart.js library
  • Responsive: All charts are responsive and resize with window changes
  • Error Handling: Robust error handling for missing canvas elements
  • AJAX Loading: Data is loaded asynchronously to prevent page blocking

Backend

  • Controller: MarketsComparizonController handles data aggregation
  • Data Methods: Separate methods for each platform data source
  • Error Handling: Graceful fallbacks for missing or corrupted data

Styling

  • CSS: Modern, responsive design with gradient backgrounds
  • Mobile: Optimized for mobile devices
  • Dark Mode: Compatible with existing dark mode toggle

Language Support

The new charts support multiple languages:

  • English (en)
  • Russian (ru)
  • Finnish (fi)
  • Armenian (hy)

All chart labels, titles, and table headers are translatable.

Usage

  1. Navigate to the main page (/)
  2. Scroll down to see the new comparison charts below existing charts
  3. Charts automatically load data via AJAX
  4. Use the refresh button to reload comparison data
  5. Charts are responsive and work on all device sizes

Data Refresh

  • Automatic: Data loads when the page loads
  • Manual: Use the refresh button in the comparison section header
  • Real-time: Data is fetched from the database, not cached

Browser Compatibility

  • Modern Browsers: Chrome, Firefox, Safari, Edge (latest versions)
  • Mobile: iOS Safari, Chrome Mobile, Samsung Internet
  • Requirements: JavaScript enabled, Canvas support

Performance Considerations

  • Lazy Loading: Charts only render when data is available
  • Debounced Resize: Window resize events are debounced to prevent performance issues
  • Memory Management: Old chart instances are properly destroyed before creating new ones
  • Error Boundaries: Graceful degradation if individual charts fail to load

Future Enhancements

Potential improvements for future versions:

  • Real-time data updates via WebSockets
  • Interactive chart tooltips with detailed information
  • Export functionality for chart data
  • Customizable chart types and layouts
  • Historical data comparison over time
  • Platform-specific filtering options