File size: 34,893 Bytes
9c5217d |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 |
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Churn Dashboard</title>
<script src="https://cdn.tailwindcss.com"></script>
<script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
<style>
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');
body {
font-family: 'Inter', sans-serif;
-webkit-font-smoothing: antialiased;
}
.sidebar {
transition: all 0.3s;
}
.chart-container {
position: relative;
height: 100%;
width: 100%;
}
@media (max-width: 768px) {
.sidebar {
transform: translateX(-100%);
position: fixed;
z-index: 50;
height: 100vh;
}
.sidebar-open {
transform: translateX(0);
}
.overlay {
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
background-color: rgba(0,0,0,0.5);
z-index: 40;
}
}
</style>
</head>
<body class="bg-gray-50 text-gray-900">
<!-- Mobile Menu Button -->
<div class="md:hidden fixed top-4 left-4 z-50">
<button id="menuBtn" class="p-2 rounded-md bg-white shadow">
<i class="fas fa-bars text-gray-800"></i>
</button>
</div>
<!-- Overlay -->
<div id="overlay" class="overlay hidden"></div>
<!-- Sidebar -->
<div id="sidebar" class="sidebar bg-white w-64 fixed h-full shadow-lg z-30">
<div class="p-4 border-b border-gray-200">
<h1 class="text-xl font-bold text-gray-900">Churn Dashboard</h1>
<p class="text-xs text-gray-500">v2.1.0</p>
</div>
<nav class="p-4">
<ul class="space-y-2">
<li>
<a href="#overview" class="flex items-center p-2 text-gray-900 rounded-lg hover:bg-gray-100">
<i class="fas fa-chart-line mr-3"></i>
<span>Overview</span>
</a>
</li>
<li>
<a href="#ml-models" class="flex items-center p-2 text-gray-900 rounded-lg hover:bg-gray-100">
<i class="fas fa-brain mr-3"></i>
<span>ML Models</span>
</a>
</li>
<li>
<a href="#segmentation" class="flex items-center p-2 text-gray-900 rounded-lg hover:bg-gray-100">
<i class="fas fa-users mr-3"></i>
<span>Segmentation</span>
</a>
</li>
<li>
<a href="#forecast" class="flex items-center p-2 text-gray-900 rounded-lg hover:bg-gray-100">
<i class="fas fa-chart-bar mr-3"></i>
<span>Forecast</span>
</a>
</li>
<li>
<a href="#alerts" class="flex items-center p-2 text-gray-900 rounded-lg hover:bg-gray-100">
<i class="fas fa-bell mr-3"></i>
<span>Alerts</span>
</a>
</li>
</ul>
</nav>
<div class="absolute bottom-0 w-full p-4 border-t border-gray-200">
<div class="flex items-center">
<div class="w-8 h-8 rounded-full bg-gray-300 flex items-center justify-center">
<i class="fas fa-user text-gray-600"></i>
</div>
<div class="ml-3">
<p class="text-sm font-medium">Admin User</p>
<p class="text-xs text-gray-500">admin@company.com</p>
</div>
</div>
</div>
</div>
<!-- Main Content -->
<div class="md:ml-64 min-h-screen">
<div class="p-6">
<!-- Header -->
<div class="flex justify-between items-center mb-8">
<h1 class="text-2xl font-bold">Churn Monitoring Dashboard</h1>
<div class="flex items-center space-x-4">
<div class="relative">
<i class="fas fa-search absolute left-3 top-1/2 transform -translate-y-1/2 text-gray-400"></i>
<input type="text" placeholder="Search..." class="pl-10 pr-4 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-1 focus:ring-gray-400">
</div>
<button class="p-2 rounded-full hover:bg-gray-200">
<i class="fas fa-cog text-gray-600"></i>
</button>
</div>
</div>
<!-- Overview Section -->
<section id="overview" class="mb-12">
<div class="flex justify-between items-center mb-6">
<h2 class="text-xl font-semibold">Churn Overview</h2>
<div class="flex space-x-2">
<select class="border border-gray-300 rounded-md px-3 py-1 text-sm focus:outline-none focus:ring-1 focus:ring-gray-400">
<option>Last 30 days</option>
<option>Last 90 days</option>
<option>Last 12 months</option>
</select>
<button class="px-3 py-1 bg-gray-900 text-white rounded-md text-sm hover:bg-gray-700">Export</button>
</div>
</div>
<div class="grid grid-cols-1 md:grid-cols-4 gap-6 mb-6">
<!-- Current Churn Rate -->
<div class="bg-white p-6 rounded-lg shadow">
<div class="flex justify-between items-start">
<div>
<p class="text-sm text-gray-500">Current Churn Rate</p>
<p class="text-3xl font-bold mt-1">12.4%</p>
<p class="text-sm mt-2 flex items-center">
<span class="text-red-500 flex items-center">
<i class="fas fa-caret-up mr-1"></i> 2.1%
</span>
<span class="text-gray-500 ml-1">vs last month</span>
</p>
</div>
<div class="w-12 h-12 bg-gray-100 rounded-full flex items-center justify-center">
<i class="fas fa-percentage text-gray-600"></i>
</div>
</div>
</div>
<!-- Retention Rate -->
<div class="bg-white p-6 rounded-lg shadow">
<div class="flex justify-between items-start">
<div>
<p class="text-sm text-gray-500">Retention Rate</p>
<p class="text-3xl font-bold mt-1">87.6%</p>
<p class="text-sm mt-2 flex items-center">
<span class="text-red-500 flex items-center">
<i class="fas fa-caret-down mr-1"></i> 1.8%
</span>
<span class="text-gray-500 ml-1">vs last month</span>
</p>
</div>
<div class="w-12 h-12 bg-gray-100 rounded-full flex items-center justify-center">
<i class="fas fa-lock text-gray-600"></i>
</div>
</div>
</div>
<!-- Lost Customers -->
<div class="bg-white p-6 rounded-lg shadow">
<div class="flex justify-between items-start">
<div>
<p class="text-sm text-gray-500">Lost Customers</p>
<p class="text-3xl font-bold mt-1">1,248</p>
<p class="text-sm mt-2 flex items-center">
<span class="text-red-500 flex items-center">
<i class="fas fa-caret-up mr-1"></i> 18%
</span>
<span class="text-gray-500 ml-1">vs last month</span>
</p>
</div>
<div class="w-12 h-12 bg-gray-100 rounded-full flex items-center justify-center">
<i class="fas fa-user-slash text-gray-600"></i>
</div>
</div>
</div>
<!-- Recovery Rate -->
<div class="bg-white p-6 rounded-lg shadow">
<div class="flex justify-between items-start">
<div>
<p class="text-sm text-gray-500">Recovery Rate</p>
<p class="text-3xl font-bold mt-1">23.2%</p>
<p class="text-sm mt-2 flex items-center">
<span class="text-green-500 flex items-center">
<i class="fas fa-caret-up mr-1"></i> 3.4%
</span>
<span class="text-gray-500 ml-1">vs last month</span>
</p>
</div>
<div class="w-12 h-12 bg-gray-100 rounded-full flex items-center justify-center">
<i class="fas fa-undo text-gray-600"></i>
</div>
</div>
</div>
</div>
<!-- Churn Trend Chart -->
<div class="bg-white p-6 rounded-lg shadow mb-6">
<div class="flex justify-between items-center mb-4">
<h3 class="font-medium">Churn Rate Trend (Last 12 Months)</h3>
<div class="flex space-x-2">
<button class="px-2 py-1 text-xs border border-gray-300 rounded-md hover:bg-gray-100">Monthly</button>
<button class="px-2 py-1 text-xs border border-gray-300 rounded-md hover:bg-gray-100">Weekly</button>
</div>
</div>
<div class="chart-container">
<canvas id="churnTrendChart"></canvas>
</div>
</div>
</section>
<!-- ML Models Section -->
<section id="ml-models" class="mb-12">
<div class="flex justify-between items-center mb-6">
<h2 class="text-xl font-semibold">Machine Learning Model Results</h2>
<button class="px-3 py-1 bg-gray-900 text-white rounded-md text-sm hover:bg-gray-700">Train New Model</button>
</div>
<div class="grid grid-cols-1 md:grid-cols-2 gap-6 mb-6">
<!-- Model Metrics -->
<div class="bg-white p-6 rounded-lg shadow">
<h3 class="font-medium mb-4">Model Performance Metrics</h3>
<div class="overflow-x-auto">
<table class="min-w-full divide-y divide-gray-200">
<thead class="bg-gray-50">
<tr>
<th class="px-4 py-2 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Model</th>
<th class="px-4 py-2 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Accuracy</th>
<th class="px-4 py-2 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Precision</th>
<th class="px-4 py-2 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Recall</th>
<th class="px-4 py-2 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">F1-Score</th>
</tr>
</thead>
<tbody class="bg-white divide-y divide-gray-200">
<tr>
<td class="px-4 py-2 whitespace-nowrap text-sm font-medium text-gray-900">XGBoost</td>
<td class="px-4 py-2 whitespace-nowrap text-sm text-gray-500">0.89</td>
<td class="px-4 py-2 whitespace-nowrap text-sm text-gray-500">0.85</td>
<td class="px-4 py-2 whitespace-nowrap text-sm text-gray-500">0.91</td>
<td class="px-4 py-2 whitespace-nowrap text-sm text-gray-500">0.88</td>
</tr>
<tr>
<td class="px-4 py-2 whitespace-nowrap text-sm font-medium text-gray-900">Random Forest</td>
<td class="px-4 py-2 whitespace-nowrap text-sm text-gray-500">0.87</td>
<td class="px-4 py-2 whitespace-nowrap text-sm text-gray-500">0.83</td>
<td class="px-4 py-2 whitespace-nowrap text-sm text-gray-500">0.89</td>
<td class="px-4 py-2 whitespace-nowrap text-sm text-gray-500">0.86</td>
</tr>
<tr>
<td class="px-4 py-2 whitespace-nowrap text-sm font-medium text-gray-900">Logistic Regression</td>
<td class="px-4 py-2 whitespace-nowrap text-sm text-gray-500">0.82</td>
<td class="px-4 py-2 whitespace-nowrap text-sm text-gray-500">0.78</td>
<td class="px-4 py-2 whitespace-nowrap text-sm text-gray-500">0.84</td>
<td class="px-4 py-2 whitespace-nowrap text-sm text-gray-500">0.81</td>
</tr>
</tbody>
</table>
</div>
</div>
<!-- ROC Curve -->
<div class="bg-white p-6 rounded-lg shadow">
<h3 class="font-medium mb-4">ROC Curve (AUC Comparison)</h3>
<div class="chart-container">
<canvas id="rocCurveChart"></canvas>
</div>
</div>
</div>
</section>
<!-- Segmentation Section -->
<section id="segmentation" class="mb-12">
<div class="flex justify-between items-center mb-6">
<h2 class="text-xl font-semibold">Customer Segmentation</h2>
<div class="flex space-x-2">
<select class="border border-gray-300 rounded-md px-3 py-1 text-sm focus:outline-none focus:ring-1 focus:ring-gray-400">
<option>By Signup Date</option>
<option>By Customer Profile</option>
<option>By Product</option>
</select>
</div>
</div>
<div class="grid grid-cols-1 md:grid-cols-2 gap-6 mb-6">
<!-- Cohort Analysis -->
<div class="bg-white p-6 rounded-lg shadow">
<h3 class="font-medium mb-4">Cohort Analysis (by Signup Date)</h3>
<div class="overflow-x-auto">
<table class="min-w-full divide-y divide-gray-200">
<thead class="bg-gray-50">
<tr>
<th class="px-4 py-2 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Cohort</th>
<th class="px-4 py-2 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Customers</th>
<th class="px-4 py-2 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Churn Rate</th>
<th class="px-4 py-2 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Retention</th>
</tr>
</thead>
<tbody class="bg-white divide-y divide-gray-200">
<tr>
<td class="px-4 py-2 whitespace-nowrap text-sm font-medium text-gray-900">Jan 2023</td>
<td class="px-4 py-2 whitespace-nowrap text-sm text-gray-500">1,245</td>
<td class="px-4 py-2 whitespace-nowrap text-sm text-gray-500">14.2%</td>
<td class="px-4 py-2 whitespace-nowrap text-sm text-gray-500">85.8%</td>
</tr>
<tr>
<td class="px-4 py-2 whitespace-nowrap text-sm font-medium text-gray-900">Feb 2023</td>
<td class="px-4 py-2 whitespace-nowrap text-sm text-gray-500">1,387</td>
<td class="px-4 py-2 whitespace-nowrap text-sm text-gray-500">12.8%</td>
<td class="px-4 py-2 whitespace-nowrap text-sm text-gray-500">87.2%</td>
</tr>
<tr>
<td class="px-4 py-2 whitespace-nowrap text-sm font-medium text-gray-900">Mar 2023</td>
<td class="px-4 py-2 whitespace-nowrap text-sm text-gray-500">1,502</td>
<td class="px-4 py-2 whitespace-nowrap text-sm text-gray-500">11.5%</td>
<td class="px-4 py-2 whitespace-nowrap text-sm text-gray-500">88.5%</td>
</tr>
<tr>
<td class="px-4 py-2 whitespace-nowrap text-sm font-medium text-gray-900">Apr 2023</td>
<td class="px-4 py-2 whitespace-nowrap text-sm text-gray-500">1,678</td>
<td class="px-4 py-2 whitespace-nowrap text-sm text-gray-500">10.9%</td>
<td class="px-4 py-2 whitespace-nowrap text-sm text-gray-500">89.1%</td>
</tr>
</tbody>
</table>
</div>
</div>
<!-- Churn by Segment -->
<div class="bg-white p-6 rounded-lg shadow">
<h3 class="font-medium mb-4">Churn Rate by Customer Segment</h3>
<div class="chart-container">
<canvas id="segmentChart"></canvas>
</div>
</div>
</div>
</section>
<!-- Forecast Section -->
<section id="forecast" class="mb-12">
<div class="flex justify-between items-center mb-6">
<h2 class="text-xl font-semibold">Churn Forecast</h2>
<div class="flex space-x-2">
<select class="border border-gray-300 rounded-md px-3 py-1 text-sm focus:outline-none focus:ring-1 focus:ring-gray-400">
<option>Next 3 Months</option>
<option>Next 6 Months</option>
<option>Next 12 Months</option>
</select>
</div>
</div>
<div class="bg-white p-6 rounded-lg shadow mb-6">
<h3 class="font-medium mb-4">Expected Churn Rate (Next 6 Months)</h3>
<div class="chart-container">
<canvas id="forecastChart"></canvas>
</div>
</div>
</section>
<!-- Alerts Section -->
<section id="alerts">
<div class="flex justify-between items-center mb-6">
<h2 class="text-xl font-semibold">Alerts & Insights</h2>
<button class="px-3 py-1 bg-gray-900 text-white rounded-md text-sm hover:bg-gray-700">View All</button>
</div>
<div class="grid grid-cols-1 md:grid-cols-2 gap-6">
<!-- Critical Alerts -->
<div class="bg-white p-6 rounded-lg shadow">
<div class="flex items-center mb-4">
<div class="w-8 h-8 rounded-full bg-red-100 flex items-center justify-center mr-3">
<i class="fas fa-exclamation text-red-500"></i>
</div>
<h3 class="font-medium">Critical Alerts</h3>
</div>
<div class="space-y-4">
<div class="p-3 border-l-4 border-red-500 bg-red-50">
<p class="text-sm font-medium">Churn rate increased by 2.1% in Premium segment</p>
<p class="text-xs text-gray-500 mt-1">Detected today at 9:42 AM</p>
</div>
<div class="p-3 border-l-4 border-red-500 bg-red-50">
<p class="text-sm font-medium">Retention dropped by 3.2% for customers aged 25-34</p>
<p class="text-xs text-gray-500 mt-1">Detected yesterday at 4:15 PM</p>
</div>
</div>
</div>
<!-- Recommendations -->
<div class="bg-white p-6 rounded-lg shadow">
<div class="flex items-center mb-4">
<div class="w-8 h-8 rounded-full bg-blue-100 flex items-center justify-center mr-3">
<i class="fas fa-lightbulb text-blue-500"></i>
</div>
<h3 class="font-medium">Actionable Recommendations</h3>
</div>
<div class="space-y-4">
<div class="p-3 border-l-4 border-blue-500 bg-blue-50">
<p class="text-sm font-medium">Offer discount to Premium segment customers with >80% churn probability</p>
<p class="text-xs text-gray-500 mt-1">Expected impact: Reduce churn by 15-20%</p>
</div>
<div class="p-3 border-l-4 border-blue-500 bg-blue-50">
<p class="text-sm font-medium">Implement loyalty program for customers with 6-12 month tenure</p>
<p class="text-xs text-gray-500 mt-1">Expected impact: Increase retention by 8-12%</p>
</div>
</div>
</div>
</div>
</section>
</div>
</div>
<script>
// Mobile menu toggle
const menuBtn = document.getElementById('menuBtn');
const sidebar = document.getElementById('sidebar');
const overlay = document.getElementById('overlay');
menuBtn.addEventListener('click', () => {
sidebar.classList.toggle('sidebar-open');
overlay.classList.toggle('hidden');
});
overlay.addEventListener('click', () => {
sidebar.classList.remove('sidebar-open');
overlay.classList.add('hidden');
});
// Charts
document.addEventListener('DOMContentLoaded', function() {
// Churn Trend Chart
const churnTrendCtx = document.getElementById('churnTrendChart').getContext('2d');
const churnTrendChart = new Chart(churnTrendCtx, {
type: 'line',
data: {
labels: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'],
datasets: [{
label: 'Churn Rate',
data: [12.5, 11.8, 10.9, 11.2, 11.5, 11.9, 12.1, 12.4, 12.8, 13.1, 12.9, 12.4],
borderColor: '#000000',
backgroundColor: 'rgba(0, 0, 0, 0.05)',
borderWidth: 2,
tension: 0.4,
fill: true
}]
},
options: {
responsive: true,
plugins: {
legend: {
position: 'top',
},
tooltip: {
callbacks: {
label: function(context) {
return context.dataset.label + ': ' + context.parsed.y + '%';
}
}
}
},
scales: {
y: {
beginAtZero: true,
ticks: {
callback: function(value) {
return value + '%';
}
}
}
}
}
});
// ROC Curve Chart
const rocCurveCtx = document.getElementById('rocCurveChart').getContext('2d');
const rocCurveChart = new Chart(rocCurveCtx, {
type: 'line',
data: {
labels: Array.from({length: 11}, (_, i) => i/10),
datasets: [
{
label: 'XGBoost (AUC = 0.94)',
data: [0, 0.1, 0.3, 0.45, 0.6, 0.75, 0.85, 0.92, 0.96, 0.98, 1],
borderColor: '#000000',
borderWidth: 2,
tension: 0.3
},
{
label: 'Random Forest (AUC = 0.91)',
data: [0, 0.08, 0.25, 0.4, 0.55, 0.7, 0.8, 0.88, 0.93, 0.96, 1],
borderColor: '#555555',
borderWidth: 2,
tension: 0.3
},
{
label: 'Logistic Regression (AUC = 0.86)',
data: [0, 0.05, 0.2, 0.35, 0.5, 0.65, 0.75, 0.83, 0.89, 0.94, 1],
borderColor: '#999999',
borderWidth: 2,
tension: 0.3
},
{
label: 'Random (AUC = 0.50)',
data: [0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1],
borderColor: '#cccccc',
borderDash: [5, 5],
borderWidth: 1,
tension: 0
}
]
},
options: {
responsive: true,
plugins: {
legend: {
position: 'top',
}
},
scales: {
x: {
title: {
display: true,
text: 'False Positive Rate'
}
},
y: {
title: {
display: true,
text: 'True Positive Rate'
}
}
}
}
});
// Segment Chart
const segmentCtx = document.getElementById('segmentChart').getContext('2d');
const segmentChart = new Chart(segmentCtx, {
type: 'bar',
data: {
labels: ['Premium', 'Standard', 'Basic', 'Trial', 'Enterprise'],
datasets: [{
label: 'Churn Rate',
data: [14.5, 12.3, 15.8, 18.2, 9.4],
backgroundColor: [
'rgba(0, 0, 0, 0.8)',
'rgba(0, 0, 0, 0.6)',
'rgba(0, 0, 0, 0.4)',
'rgba(0, 0, 0, 0.3)',
'rgba(0, 0, 0, 0.2)'
],
borderColor: [
'rgba(0, 0, 0, 1)',
'rgba(0, 0, 0, 1)',
'rgba(0, 0, 0, 1)',
'rgba(0, 0, 0, 1)',
'rgba(0, 0, 0, 1)'
],
borderWidth: 1
}]
},
options: {
responsive: true,
plugins: {
legend: {
display: false
},
tooltip: {
callbacks: {
label: function(context) {
return context.parsed.y + '%';
}
}
}
},
scales: {
y: {
beginAtZero: true,
ticks: {
callback: function(value) {
return value + '%';
}
}
}
}
}
});
// Forecast Chart
const forecastCtx = document.getElementById('forecastChart').getContext('2d');
const forecastChart = new Chart(forecastCtx, {
type: 'bar',
data: {
labels: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun'],
datasets: [
{
label: 'Forecasted Churn',
data: [12.8, 13.2, 13.5, 13.9, 14.2, 14.5],
backgroundColor: 'rgba(0, 0, 0, 0.2)',
borderColor: 'rgba(0, 0, 0, 1)',
borderWidth: 1,
type: 'bar'
},
{
label: 'Upper Bound',
data: [13.5, 13.9, 14.2, 14.6, 14.9, 15.2],
borderColor: '#888888',
backgroundColor: 'rgba(0, 0, 0, 0)',
borderWidth: 1,
borderDash: [5, 5],
type: 'line',
pointRadius: 0
},
{
label: 'Lower Bound',
data: [12.1, 12.5, 12.8, 13.2, 13.5, 13.8],
borderColor: '#888888',
backgroundColor: 'rgba(0, 0, 0, 0)',
borderWidth: 1,
borderDash: [5, 5],
type: 'line',
pointRadius: 0
}
]
},
options: {
responsive: true,
plugins: {
legend: {
position: 'top',
},
tooltip: {
callbacks: {
label: function(context) {
return context.dataset.label + ': ' + context.parsed.y + '%';
}
}
}
},
scales: {
y: {
beginAtZero: true,
ticks: {
callback: function(value) {
return value + '%';
}
}
}
}
}
});
});
</script>
<p style="border-radius: 8px; text-align: center; font-size: 12px; color: #fff; margin-top: 16px;position: fixed; left: 8px; bottom: 8px; z-index: 10; background: rgba(0, 0, 0, 0.8); padding: 4px 8px;">Made with <img src="https://enzostvs-deepsite.hf.space/logo.svg" alt="DeepSite Logo" style="width: 16px; height: 16px; vertical-align: middle;display:inline-block;margin-right:3px;filter:brightness(0) invert(1);"><a href="https://enzostvs-deepsite.hf.space" style="color: #fff;text-decoration: underline;" target="_blank" >DeepSite</a> - 🧬 <a href="https://enzostvs-deepsite.hf.space?remix=manoela/teste" style="color: #fff;text-decoration: underline;" target="_blank" >Remix</a></p></body>
</html> |