Data Consumption Calculator

Data Consumption Calculator: Estimate Your Monthly Usage :root { –primary-color: #004a99; –success-color: #28a745; –background-color: #f8f9fa; –text-color: #333; –border-color: #ddd; –card-background: #fff; –shadow: 0 2px 5px rgba(0,0,0,0.1); } body { font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; background-color: var(–background-color); color: var(–text-color); line-height: 1.6; margin: 0; padding: 0; } .container { max-width: 1000px; margin: 20px auto; padding: 20px; background-color: var(–card-background); border-radius: 8px; box-shadow: var(–shadow); } h1, h2, h3 { color: var(–primary-color); text-align: center; margin-bottom: 20px; } h1 { font-size: 2.2em; } h2 { font-size: 1.8em; margin-top: 30px; border-bottom: 2px solid var(–primary-color); padding-bottom: 10px; } h3 { font-size: 1.4em; margin-top: 25px; } .calculator-wrapper { background-color: var(–card-background); padding: 30px; border-radius: 8px; box-shadow: var(–shadow); margin-bottom: 30px; } .input-group { margin-bottom: 20px; text-align: left; } .input-group label { display: block; margin-bottom: 8px; font-weight: bold; color: var(–primary-color); } .input-group input[type="number"], .input-group select { width: calc(100% – 22px); padding: 10px; border: 1px solid var(–border-color); border-radius: 4px; font-size: 1em; box-sizing: border-box; } .input-group input[type="number"]:focus, .input-group select:focus { outline: none; border-color: var(–primary-color); box-shadow: 0 0 0 2px rgba(0, 74, 153, 0.2); } .input-group .helper-text { font-size: 0.85em; color: #666; margin-top: 5px; display: block; } .error-message { color: red; font-size: 0.8em; margin-top: 5px; display: none; /* Hidden by default */ } .button-group { display: flex; justify-content: space-between; margin-top: 25px; gap: 10px; } .button-group button { padding: 12px 20px; border: none; border-radius: 5px; cursor: pointer; font-size: 1em; font-weight: bold; transition: background-color 0.3s ease; flex: 1; } .button-group button.calculate-btn { background-color: var(–primary-color); color: white; } .button-group button.calculate-btn:hover { background-color: #003366; } .button-group button.reset-btn { background-color: #6c757d; color: white; } .button-group button.reset-btn:hover { background-color: #5a6268; } .button-group button.copy-btn { background-color: var(–success-color); color: white; } .button-group button.copy-btn:hover { background-color: #218838; } #results-container { margin-top: 30px; padding: 25px; background-color: var(–card-background); border-radius: 8px; box-shadow: var(–shadow); text-align: center; } #results-container h3 { margin-top: 0; color: var(–primary-color); } .result-item { margin-bottom: 15px; } .result-item .label { font-weight: bold; color: var(–primary-color); display: block; margin-bottom: 5px; } .result-item .value { font-size: 1.8em; font-weight: bold; color: var(–primary-color); display: block; } .result-item .unit { font-size: 0.9em; color: #555; } .intermediate-results .result-item .value { font-size: 1.4em; } .formula-explanation { font-size: 0.9em; color: #555; margin-top: 15px; padding: 10px; background-color: #e9ecef; border-radius: 4px; } table { width: 100%; border-collapse: collapse; margin-top: 20px; box-shadow: var(–shadow); } th, td { padding: 12px 15px; text-align: left; border: 1px solid var(–border-color); } thead { background-color: var(–primary-color); color: white; } tbody tr:nth-child(even) { background-color: #f2f2f2; } caption { font-size: 1.1em; font-weight: bold; color: var(–primary-color); margin-bottom: 10px; caption-side: top; text-align: left; } canvas { display: block; margin: 20px auto; max-width: 100%; border: 1px solid var(–border-color); border-radius: 4px; } .article-content { margin-top: 40px; background-color: var(–card-background); padding: 30px; border-radius: 8px; box-shadow: var(–shadow); } .article-content p, .article-content ul, .article-content ol { margin-bottom: 15px; } .article-content ul, .article-content ol { padding-left: 25px; } .article-content li { margin-bottom: 8px; } .article-content a { color: var(–primary-color); text-decoration: none; } .article-content a:hover { text-decoration: underline; } .faq-item { margin-bottom: 15px; border-left: 3px solid var(–primary-color); padding-left: 10px; } .faq-item strong { color: var(–primary-color); display: block; margin-bottom: 5px; } .related-tools ul { list-style: none; padding: 0; } .related-tools li { margin-bottom: 10px; } .related-tools a { font-weight: bold; } .related-tools span { font-size: 0.9em; color: #555; display: block; margin-top: 3px; } .highlighted-result { background-color: var(–success-color); color: white; padding: 15px; border-radius: 5px; margin-bottom: 20px; font-size: 1.5em; font-weight: bold; box-shadow: inset 0 0 10px rgba(0,0,0,0.2); } .highlighted-result .label { color: white; margin-bottom: 8px; } .highlighted-result .value { color: white; font-size: 2em; } .highlighted-result .unit { color: rgba(255, 255, 255, 0.8); } .chart-container { position: relative; width: 100%; margin-top: 20px; background-color: var(–card-background); padding: 20px; border-radius: 8px; box-shadow: var(–shadow); } .chart-container figcaption { font-size: 1em; font-weight: bold; color: var(–primary-color); margin-bottom: 10px; text-align: center; }

Data Consumption Calculator

Estimate your monthly internet data usage accurately.

Your Data Usage Estimator

Estimate total hours spent streaming videos like YouTube, Netflix, etc. per month.
Standard Definition (SD) High Definition (HD) Ultra High Definition (UHD/4K) Select the typical quality of your video streams.
Estimate total hours spent on social media platforms (scrolling feeds, watching videos) per month.
Estimate total hours spent browsing websites, reading articles, etc. per month.
Estimate total hours spent playing online multiplayer games per month.
Estimate total hours spent on video calls (Zoom, Skype, FaceTime) per month.
Estimate the total size of files you download (software, movies, documents) in Gigabytes per month.

Your Estimated Monthly Data Consumption

Total Estimated Usage
GB
Streaming Data
GB
Social Media Data
GB
Web Browsing Data
GB
Online Gaming Data
GB
Video Call Data
GB
Downloaded Files Data
GB
How it's calculated:

Total Data = (Streaming Hours * Streaming Rate) + (Social Media Hours * Social Media Rate) + (Browsing Hours * Browsing Rate) + (Gaming Hours * Gaming Rate) + (Video Call Hours * Video Call Rate) + File Downloads (GB).

Rates are estimates based on typical usage per hour in GB.

Monthly Data Consumption Breakdown
Estimated Data Usage Rates (GB per Hour)
Activity SD Quality HD Quality UHD/4K Quality
Video Streaming 1.0 GB 3.0 GB 7.0 GB
Social Media (with media) 0.5 GB 0.5 GB 0.5 GB
Web Browsing 0.1 GB 0.1 GB 0.1 GB
Online Gaming 0.2 GB 0.2 GB 0.2 GB
Video Calls 1.0 GB 1.5 GB 2.0 GB

Understanding Your Data Consumption

What is Data Consumption?

Data consumption, often referred to as data usage, is the amount of internet data transferred to and from your device over a specific period. Every time you browse a website, stream a video, send an email, or play an online game, you are consuming data. Understanding your data consumption is crucial for managing your internet service, especially with mobile data plans or home internet packages that have data caps or tiered pricing. It helps you avoid unexpected charges, choose the most cost-effective plan, and ensure you have enough data for your online activities.

Who should use a data consumption calculator? Anyone with a metered internet connection, including:

  • Mobile phone users on data plans.
  • Home internet users with data caps or usage-based billing.
  • Businesses monitoring network usage.
  • Individuals looking to optimize their internet spending.

Common misconceptions about data consumption include:

  • Thinking that all streaming is the same: Video quality (SD, HD, UHD) drastically impacts data usage.
  • Underestimating social media: While individual posts might be small, the sheer volume of videos and images can add up quickly.
  • Believing that browsing is negligible: While generally low, extensive browsing with many images and videos can still contribute.

Data Consumption Calculator Formula and Mathematical Explanation

The data consumption calculator estimates your total monthly internet data usage by summing up the estimated data consumed by various online activities. Each activity is assigned a data rate (GB per hour) based on its typical intensity, and this rate is multiplied by the hours spent on that activity.

The core formula is:

Total Data (GB) = (Streaming Hours × Streaming Rate) + (Social Media Hours × Social Media Rate) + (Web Browsing Hours × Browsing Rate) + (Online Gaming Hours × Gaming Rate) + (Video Call Hours × Video Call Rate) + File Downloads (GB)

Variable Explanations:

Variables Used in Data Consumption Calculation
Variable Meaning Unit Typical Range
Streaming Hours Total hours spent streaming video content per month. Hours 0 – 200+
Streaming Rate Estimated data consumed per hour of video streaming, varying by quality (SD, HD, UHD). GB/Hour 0.5 GB (SD) – 7.0 GB (UHD)
Social Media Hours Total hours spent on social media platforms per month. Hours 0 – 150+
Social Media Rate Estimated data consumed per hour of social media use. GB/Hour 0.3 GB – 1.0 GB
Web Browsing Hours Total hours spent browsing websites per month. Hours 0 – 100+
Browsing Rate Estimated data consumed per hour of web browsing. GB/Hour 0.05 GB – 0.2 GB
Online Gaming Hours Total hours spent playing online multiplayer games per month. Hours 0 – 80+
Gaming Rate Estimated data consumed per hour of online gaming. GB/Hour 0.1 GB – 0.5 GB
Video Call Hours Total hours spent on video calls per month. Hours 0 – 50+
Video Call Rate Estimated data consumed per hour of video calls. GB/Hour 0.8 GB – 2.0 GB
File Downloads (GB) Total size of files downloaded per month. GB 0 – 500+

Practical Examples (Real-World Use Cases)

Let's illustrate with a couple of scenarios:

Example 1: The Casual User

Sarah uses her home internet primarily for occasional streaming, social media, and browsing.

  • Streaming Hours: 8 hours (HD)
  • Social Media Hours: 15 hours
  • Web Browsing Hours: 25 hours
  • Online Gaming Hours: 0 hours
  • Video Call Hours: 2 hours
  • File Downloads: 5 GB

Calculation:

  • Streaming Data: 8 hours * 3.0 GB/hour = 24 GB
  • Social Media Data: 15 hours * 0.5 GB/hour = 7.5 GB
  • Web Browsing Data: 25 hours * 0.1 GB/hour = 2.5 GB
  • Online Gaming Data: 0 hours * 0.2 GB/hour = 0 GB
  • Video Call Data: 2 hours * 1.5 GB/hour = 3 GB
  • Downloaded Files: 5 GB

Total Estimated Usage: 24 + 7.5 + 2.5 + 0 + 3 + 5 = 42 GB

Interpretation: Sarah's usage is relatively low. A basic internet plan with a cap around 50-100 GB would likely suffice, offering cost savings.

Example 2: The Power User

Mark works from home, frequently uses video conferencing, streams in high definition, and downloads large files.

  • Streaming Hours: 40 hours (HD)
  • Social Media Hours: 30 hours
  • Web Browsing Hours: 50 hours
  • Online Gaming Hours: 10 hours
  • Video Call Hours: 15 hours
  • File Downloads: 100 GB

Calculation:

  • Streaming Data: 40 hours * 3.0 GB/hour = 120 GB
  • Social Media Data: 30 hours * 0.5 GB/hour = 15 GB
  • Web Browsing Data: 50 hours * 0.1 GB/hour = 5 GB
  • Online Gaming Data: 10 hours * 0.2 GB/hour = 2 GB
  • Video Call Data: 15 hours * 1.5 GB/hour = 22.5 GB
  • Downloaded Files: 100 GB

Total Estimated Usage: 120 + 15 + 5 + 2 + 22.5 + 100 = 264.5 GB

Interpretation: Mark's data consumption is high. He would need an unlimited data plan or a plan with a very high data cap (e.g., 300 GB or more) to avoid overage charges. Understanding this helps him negotiate better rates or choose a suitable provider.

How to Use This Data Consumption Calculator

Using the Data Consumption Calculator is straightforward:

  1. Input Your Activities: Enter the estimated number of hours you spend on each activity (video streaming, social media, web browsing, online gaming, video calls) per month.
  2. Select Streaming Quality: Choose the quality setting (SD, HD, UHD/4K) you most commonly use for video streaming. This significantly impacts the calculation.
  3. Estimate File Downloads: Input the total approximate size (in Gigabytes) of files you download monthly.
  4. Calculate: Click the "Calculate Usage" button.
  5. Review Results: The calculator will display your total estimated monthly data consumption in GB, along with the breakdown for each activity.
  6. Interpret: Use the results to understand your data habits. This information is vital for choosing the right internet plan, whether it's mobile or home broadband. If your estimated usage exceeds your plan's limit, consider reducing usage of data-intensive activities or upgrading your plan.
  7. Reset: Use the "Reset" button to clear all fields and start over with default values.
  8. Copy: Use the "Copy Results" button to copy the key figures for easy sharing or record-keeping.

Decision-making guidance: If your estimated total is close to or exceeds your data cap, you might be at risk of overage fees. Consider switching to a plan with a higher cap or unlimited data. If your usage is significantly lower than your cap, you might be overpaying for a plan that offers more data than you need.

Key Factors That Affect Data Consumption Results

Several factors can influence your actual data consumption compared to the calculator's estimates:

  1. Video Streaming Quality: This is arguably the biggest variable. Streaming in UHD/4K uses significantly more data per hour than SD. Even HD uses 2-3 times more than SD.
  2. Background App Usage: Many apps consume data in the background for updates, notifications, and syncing, even when not actively used. This calculator primarily focuses on active usage.
  3. Website Complexity: Websites with many high-resolution images, embedded videos, or complex scripts consume more data than simple text-based pages.
  4. Device Type and Settings: Different devices may handle data compression differently. Mobile devices might use data-saving modes that reduce consumption.
  5. Software Updates: Operating system and application updates, especially for large programs or games, can consume substantial amounts of data in a single download.
  6. Data Compression: Some services and browsers employ data compression techniques, which can reduce the amount of data transferred, making actual usage lower than estimates.
  7. Live Streaming vs. On-Demand: Live streams can sometimes be more data-intensive than on-demand content due to continuous data flow.
  8. File Download Habits: Regularly downloading large files like movies, games, or software significantly increases monthly data usage beyond typical browsing and streaming.

Frequently Asked Questions (FAQ)

Q1: How accurate are these data usage estimates?

A: The estimates are based on industry averages and typical usage patterns. Actual usage can vary based on specific services, device settings, and network conditions. This calculator provides a good baseline for planning.

Q2: Does Wi-Fi usage count towards my mobile data?

A: No. When you are connected to Wi-Fi, your device uses the Wi-Fi network's internet connection, not your mobile data plan. This calculator assumes you are estimating usage on a metered connection (like mobile data or a capped home internet plan).

Q3: What is considered "high" data consumption?

A: "High" is relative to your plan's limits. For a typical 50 GB mobile plan, exceeding 40-45 GB might be considered high. For a 1 TB home internet plan, exceeding 800 GB could be considered high. Generally, over 100 GB per month for a single user is considered significant.

Q4: How can I reduce my data consumption?

A: Prioritize Wi-Fi for large downloads and streaming. Lower video streaming quality. Limit background app data usage. Download content for offline viewing when possible. Be mindful of social media video auto-play.

Q5: Does online gaming use a lot of data?

A: Compared to video streaming, online gaming typically uses less data per hour. However, downloading game updates or the games themselves can consume massive amounts of data.

Q6: What's the difference between GB and MB?

A: GB stands for Gigabyte, and MB stands for Megabyte. 1 GB is equal to 1024 MB. Data plans are usually measured in GB.

Q7: My internet provider shows different usage numbers. Why?

A: Providers often have their own methods for tracking data, which might include overhead or different compression algorithms. Their figures are the official ones for billing purposes.

Q8: Can I use this calculator for my home internet plan?

A: Yes, absolutely. If your home internet plan has a data cap or usage-based billing, this calculator helps you estimate your monthly usage to avoid exceeding limits or to choose the most appropriate plan.

© 2023 Your Website Name. All rights reserved.

var streamingRate = { sd: 1.0, hd: 3.0, uhd: 7.0 }; var socialMediaRate = 0.5; var webBrowsingRate = 0.1; var onlineGamingRate = 0.2; var videoCallsRate = { sd: 1.0, hd: 1.5, uhd: 2.0 }; // Using SD/HD/UHD for consistency, though typically HD is common function validateInput(id, errorId, min, max) { var input = document.getElementById(id); var errorElement = document.getElementById(errorId); var value = parseFloat(input.value); errorElement.style.display = 'none'; // Hide error by default if (isNaN(value)) { errorElement.textContent = "Please enter a valid number."; errorElement.style.display = 'block'; return false; } if (value max) { errorElement.textContent = "Value is too high."; errorElement.style.display = 'block'; return false; } return true; } function calculateDataConsumption() { // Clear previous errors document.getElementById('streamingHoursError').style.display = 'none'; document.getElementById('socialMediaHoursError').style.display = 'none'; document.getElementById('webBrowsingHoursError').style.display = 'none'; document.getElementById('onlineGamingHoursError').style.display = 'none'; document.getElementById('videoCallsHoursError').style.display = 'none'; document.getElementById('fileDownloadsGBError').style.display = 'none'; // Validate inputs var validStreamingHours = validateInput('streamingHours', 'streamingHoursError', 0); var validSocialMediaHours = validateInput('socialMediaHours', 'socialMediaHoursError', 0); var validWebBrowsingHours = validateInput('webBrowsingHours', 'webBrowsingHoursError', 0); var validOnlineGamingHours = validateInput('onlineGamingHours', 'onlineGamingHoursError', 0); var validVideoCallsHours = validateInput('videoCallsHours', 'videoCallsHoursError', 0); var validFileDownloadsGB = validateInput('fileDownloadsGB', 'fileDownloadsGBError', 0); if (!validStreamingHours || !validSocialMediaHours || !validWebBrowsingHours || !validOnlineGamingHours || !validVideoCallsHours || !validFileDownloadsGB) { return; // Stop calculation if any input is invalid } var streamingHours = parseFloat(document.getElementById('streamingHours').value); var streamingQuality = document.getElementById('streamingQuality').value; var socialMediaHours = parseFloat(document.getElementById('socialMediaHours').value); var webBrowsingHours = parseFloat(document.getElementById('webBrowsingHours').value); var onlineGamingHours = parseFloat(document.getElementById('onlineGamingHours').value); var videoCallsHours = parseFloat(document.getElementById('videoCallsHours').value); var fileDownloadsGB = parseFloat(document.getElementById('fileDownloadsGB').value); var currentStreamingRate = streamingRate[streamingQuality] || streamingRate.hd; // Default to HD if quality is unrecognized var currentVideoCallRate = videoCallsRate[streamingQuality] || videoCallsRate.hd; // Use same quality logic for video calls var streamingData = streamingHours * currentStreamingRate; var socialMediaData = socialMediaHours * socialMediaRate; var webBrowsingData = webBrowsingHours * webBrowsingRate; var onlineGamingData = onlineGamingHours * onlineGamingRate; var videoCallsData = videoCallsHours * currentVideoCallRate; var totalUsage = streamingData + socialMediaData + webBrowsingData + onlineGamingData + videoCallsData + fileDownloadsGB; document.getElementById('streamingDataValue').textContent = streamingData.toFixed(2); document.getElementById('socialMediaDataValue').textContent = socialMediaData.toFixed(2); document.getElementById('webBrowsingDataValue').textContent = webBrowsingData.toFixed(2); document.getElementById('onlineGamingDataValue').textContent = onlineGamingData.toFixed(2); document.getElementById('videoCallsDataValue').textContent = videoCallsData.toFixed(2); document.getElementById('downloadedFilesDataValue').textContent = fileDownloadsGB.toFixed(2); document.getElementById('totalUsageValue').textContent = totalUsage.toFixed(2); updateChart(streamingData, socialMediaData, webBrowsingData, onlineGamingData, videoCallsData, fileDownloadsGB); } function resetCalculator() { document.getElementById('streamingHours').value = 10; document.getElementById('streamingQuality').value = 'hd'; document.getElementById('socialMediaHours').value = 20; document.getElementById('webBrowsingHours').value = 30; document.getElementById('onlineGamingHours').value = 5; document.getElementById('videoCallsHours').value = 3; document.getElementById('fileDownloadsGB').value = 10; // Clear errors var errorElements = document.querySelectorAll('.error-message'); for (var i = 0; i < errorElements.length; i++) { errorElements[i].style.display = 'none'; } calculateDataConsumption(); // Recalculate with default values } function copyResults() { var totalUsage = document.getElementById('totalUsageValue').textContent; var streamingData = document.getElementById('streamingDataValue').textContent; var socialMediaData = document.getElementById('socialMediaDataValue').textContent; var webBrowsingData = document.getElementById('webBrowsingDataValue').textContent; var onlineGamingData = document.getElementById('onlineGamingDataValue').textContent; var videoCallsData = document.getElementById('videoCallsDataValue').textContent; var downloadedFilesData = document.getElementById('downloadedFilesDataValue').textContent; var assumptions = "Key Assumptions:\n"; assumptions += "- Streaming Quality: " + document.getElementById('streamingQuality').options[document.getElementById('streamingQuality').selectedIndex].text + "\n"; assumptions += "- Streaming Rate: " + (streamingRate[document.getElementById('streamingQuality').value] || streamingRate.hd).toFixed(1) + " GB/hr\n"; assumptions += "- Social Media Rate: " + socialMediaRate.toFixed(1) + " GB/hr\n"; assumptions += "- Web Browsing Rate: " + webBrowsingRate.toFixed(1) + " GB/hr\n"; assumptions += "- Online Gaming Rate: " + onlineGamingRate.toFixed(1) + " GB/hr\n"; assumptions += "- Video Call Rate: " + (videoCallsRate[document.getElementById('streamingQuality').value] || videoCallsRate.hd).toFixed(1) + " GB/hr\n"; var textToCopy = "— Data Consumption Results —\n\n"; textToCopy += "Total Estimated Monthly Usage: " + totalUsage + " GB\n\n"; textToCopy += "Breakdown:\n"; textToCopy += "- Streaming Data: " + streamingData + " GB\n"; textToCopy += "- Social Media Data: " + socialMediaData + " GB\n"; textToCopy += "- Web Browsing Data: " + webBrowsingData + " GB\n"; textToCopy += "- Online Gaming Data: " + onlineGamingData + " GB\n"; textToCopy += "- Video Call Data: " + videoCallsData + " GB\n"; textToCopy += "- Downloaded Files: " + downloadedFilesData + " GB\n\n"; textToCopy += assumptions; // Use a temporary textarea to copy text var textArea = document.createElement("textarea"); textArea.value = textToCopy; textArea.style.position = "fixed"; textArea.style.left = "-9999px"; document.body.appendChild(textArea); textArea.focus(); textArea.select(); try { var successful = document.execCommand('copy'); var msg = successful ? 'Results copied!' : 'Copying failed'; console.log(msg); // Optionally show a temporary message to the user var copyButton = document.querySelector('.copy-btn'); var originalText = copyButton.textContent; copyButton.textContent = msg; setTimeout(function() { copyButton.textContent = originalText; }, 2000); } catch (err) { console.error('Fallback: Oops, unable to copy', err); } document.body.removeChild(textArea); } function updateChart(streamingData, socialMediaData, webBrowsingData, onlineGamingData, videoCallsData, fileDownloadsGB) { var ctx = document.getElementById('dataConsumptionChart').getContext('2d'); // Destroy previous chart instance if it exists if (window.myChart instanceof Chart) { window.myChart.destroy(); } window.myChart = new Chart(ctx, { type: 'bar', // Changed to bar for better comparison of categories data: { labels: ['Streaming', 'Social Media', 'Browsing', 'Gaming', 'Video Calls', 'Downloads'], datasets: [{ label: 'Data Usage (GB)', data: [ streamingData, socialMediaData, webBrowsingData, onlineGamingData, videoCallsData, fileDownloadsGB ], backgroundColor: [ 'rgba(0, 74, 153, 0.6)', // Primary Blue 'rgba(40, 167, 69, 0.6)', // Success Green 'rgba(108, 117, 125, 0.6)', // Muted Gray 'rgba(255, 193, 7, 0.6)', // Warning Yellow 'rgba(23, 162, 184, 0.6)', // Info Cyan 'rgba(108, 117, 125, 0.6)' // Muted Gray ], borderColor: [ 'rgba(0, 74, 153, 1)', 'rgba(40, 167, 69, 1)', 'rgba(108, 117, 125, 1)', 'rgba(255, 193, 7, 1)', 'rgba(23, 162, 184, 1)', 'rgba(108, 117, 125, 1)' ], borderWidth: 1 }] }, options: { responsive: true, maintainAspectRatio: false, scales: { y: { beginAtZero: true, title: { display: true, text: 'Data Usage (GB)' } } }, plugins: { legend: { display: false // Hide legend as labels are on the bars }, tooltip: { callbacks: { label: function(context) { var label = context.dataset.label || ''; if (label) { label += ': '; } if (context.parsed.y !== null) { label += context.parsed.y.toFixed(2) + ' GB'; } return label; } } } } } }); } // Initial calculation on page load document.addEventListener('DOMContentLoaded', function() { calculateDataConsumption(); });

Leave a Comment