The user wants a pricing waterfall visualization showing the flow from "List Price" to "Pocket Price" with various "Leakage" items in between. This is a common business visualization used in pricing analytics to show how the final realized price (pocket price) is reached after all discounts, rebates, and other deductions.
A typical pricing waterfall flows:
- List Price (starting point)
- Various discounts/leakages (negative values):
- Standard Discounts
- Promotional Discounts
- Rebates
- Payment Terms
- Freight/Logistics
- Other deductions
- Pocket Price (final value)
I'll create an interactive, visually appealing waterfall chart using SVG and JavaScript with:
- A proper waterfall visualization with connected bars
- Smooth animations
- Hover effects showing detailed information
- A professional color scheme
- Maybe a dark theme with accent colors
- Interactive elements
Let me design this with:
- A sophisticated dark theme (not the cliché purple gradient)
- Cyan/teal accent for positive values
- Coral/red for leakages (negative)
- Gold/amber for the final pocket price
- Animated bars that build up sequentially
- Connecting lines between bars
- Hover states with tooltips
- Maybe a side panel showing breakdown percentages
I'll use Canvas or SVG for the visualization. SVG might be cleaner for this type of chart with better interactivity.
Let me create a sophisticated, professional pricing waterfall visualization.
Pricing Waterfall Visualization
I'll create an interactive pricing waterfall chart showing the flow from List Price to Pocket Price, with all the leakage components in between. This visualization will feature:
- Animated waterfall bars with connecting lines
- Interactive hover states showing detailed breakdown
- Color-coded categories (positive vs negative flow)
- Real-time calculations of percentages
- Professional dark theme with accent colors
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Pricing Waterfall Analysis</title>
<style>
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
font-family: 'Segoe UI', system-ui, sans-serif;
background: linear-gradient(135deg, #0f1419 0%, #1a252f 50%, #0d1117 100%);
min-height: 100vh;
color: #e6edf3;
overflow-x: hidden;
}
.container {
max-width: 1400px;
margin: 0 auto;
padding: 40px 20px;
}
header {
text-align: center;
margin-bottom: 50px;
position: relative;
}
h1 {
font-size: 2.5rem;
font-weight: 600;
background: linear-gradient(90deg, #58a6ff, #3fb950);
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
background-clip: text;
margin-bottom: 10px;
}
.subtitle {
color: #8b949e;
font-size: 1.1rem;
}
.metrics-bar {
display: flex;
justify-content: center;
gap: 60px;
margin-bottom: 40px;
flex-wrap: wrap;
}
.metric {
text-align: center;
padding: 20px 30px;
background: rgba(33, 38, 45, 0.8);
border-radius: 12px;
border: 1px solid #30363d;
transition: transform 0.3s, box-shadow 0.3s;
}
.metric:hover {
transform: translateY(-5px);
box-shadow: 0 10px 40px rgba(88, 166, 255, 0.15);
}
.metric-value {
font-size: 2rem;
font-weight: 700;
}
.metric-value.positive { color: #3fb950; }
.metric-value.negative { color: #f85149; }
.metric-value.neutral { color: #58a6ff; }
.metric-label {
color: #8b949e;
font-size: 0.9rem;
margin-top: 5px;
}
.waterfall-container {
background: rgba(22, 27, 34, 0.9);
border-radius: 16px;
padding: 40px;
border: 1px solid #30363d;
position: relative;
overflow: hidden;
}
.waterfall-container::before {
content: '';
position: absolute;
top: 0;
left: 0;
right: 0;
height: 2px;
background: linear-gradient(90deg, transparent, #58a6ff, #3fb950, transparent);
}
.chart-area {
position: relative;
height: 500px;
margin-top: 30px;
}
.waterfall-svg {
width: 100%;
height: 100%;
}
.bar-group {
cursor: pointer;
transition: filter 0.3s;
}
.bar-group:hover {
filter: brightness(1.2);
}
.bar-rect {
transition: all 0.3s ease;
}
.connector-line {
stroke: #484f58;
stroke-width: 1;
stroke-dasharray: 4, 4;
opacity: 0.6;
}
.bar-label {
font-size: 12px;
fill: #e6edf3;
font-weight: 500;
}
.bar-value {
font-size: 11px;
fill: #8b949e;
}
.bar-amount {
font-size: 13px;
font-weight: 600;
}
.axis-line {
stroke: #30363d;
stroke-width: 1;
}
.grid-line {
stroke: #21262d;
stroke-width: 1;
}
.axis-label {
font-size: 11px;
fill: #8b949e;
}
.legend {
display: flex;
justify-content: center;
gap: 40px;
margin-top: 30px;
flex-wrap: wrap;
}
.legend-item {
display: flex;
align-items: center;
gap: 10px;
}
.legend-color {
width: 16px;
height: 16px;
border-radius: 4px;
}
.legend-text {
color: #8b949e;
font-size: 0.9rem;
}
.tooltip {
position: fixed;
background: rgba(33, 38, 45, 0.98);
border: 1px solid #58a6ff;
border-radius: 8px;
padding: 15px 20px;
pointer-events: none;
opacity: 0;
transition: opacity 0.2s;
z-index: 1000;
box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
max-width: 280px;
}
.tooltip.visible {
opacity: 1;
}
.tooltip-title {
font-weight: 600;
font-size: 1rem;
margin-bottom: 8px;
color: #e6edf3;
}
.tooltip-row {
display: flex;
justify-content: space-between;
gap: 20px;
margin: 5px 0;
font-size: 0.85rem;
}
.tooltip-label {
color: #8b949e;
}
.tooltip-value {
font-weight: 600;
}
.tooltip-value.positive { color: #3fb950; }
.tooltip-value.negative { color: #f85149; }
.breakdown-section {
margin-top: 50px;
}
.section-title {
font-size: 1.3rem;
font-weight: 600;
margin-bottom: 20px;
color: #e6edf3;
}
.breakdown-grid {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
gap: 15px;
}
.breakdown-item {
background: rgba(33, 38, 45, 0.6);
border-radius: 10px;
padding: 20px;
border-left: 3px solid;
transition: all 0.3s;
}
.breakdown-item:hover {
background: rgba(33, 38, 45, 0.9);
transform: translateX(5px);
}
.breakdown-item.leakage {
border-color: #f85149;
}
.breakdown-item.start, .breakdown-item.end {
border-color: #3fb950;
}
.breakdown-name {
font-size: 0.9rem;
color: #8b949e;
margin-bottom: 5px;
}
.breakdown-amount {
font-size: 1.3rem;
font-weight: 600;
color: #e6edf3;
}
.breakdown-percent {
font-size: 0.85rem;
color: #8b949e;
margin-top: 5px;
}
.particles-bg {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
pointer-events: none;
z-index: -1;
}
@keyframes float {
0%, 100% { transform: translateY(0) rotate(0deg); opacity: 0.3; }
50% { transform: translateY(-20px) rotate(180deg); opacity: 0.6; }
}
.particle {
position: absolute;
width: 4px;
height: 4px;
background: #58a6ff;
border-radius: 50%;
animation: float 8s infinite ease-in-out;
}
@media (max-width: 768px) {
h1 { font-size: 1.8rem; }
.metrics-bar { gap: 20px; }
.metric { padding: 15px 20px; }
.metric-value { font-size: 1.5rem; }
.chart-area { height: 400px; }
.waterfall-container { padding: 20px; }
}
</style>
</head>
<body>
<div class="particles-bg" id="particles"></div>
<div class="container">
<header>
<h1>Pricing Waterfall Analysis</h1>
<p class="subtitle">List to Pocket Price | Leakage Breakdown</p>
</header>
<div class="metrics-bar">
<div class="metric">
<div class="metric-value neutral" id="listPrice">$1,000.00</div>
<div class="metric-label">List Price</div>
</div>
<div class="metric">
<div class="metric-value negative" id="totalLeakage">-$302.50</div>
<div class="metric-label">Total Leakage</div>
</div>
<div class="metric">
<div class="metric-value positive" id="pocketPrice">$697.50</div>
<div class="metric-label">Pocket Price</div>
</div>
<div class="metric">
<div class="metric-value negative" id="leakagePercent">30.3%</div>
<div class="metric-label">Leakage Rate</div>
</div>
</div>
<div class="waterfall-container">
<svg class="waterfall-svg" id="waterfallChart"></svg>
</div>
<div class="legend">
<div class="legend-item">
<div class="legend-color" style="background: linear-gradient(135deg, #3fb950, #2ea043);"></div>
<span class="legend-text">List / Pocket Price</span>
</div>
<div class="legend-item">
<div class="legend-color" style="background: linear-gradient(135deg, #f85149, #da3633);"></div>
<span class="legend-text">Leakage (Deductions)</span>
</div>
<div class="legend-item">
<div class="legend-color" style="background: linear-gradient(135deg, #58a6ff, #388bfd);"></div>
<span class="legend-text">Net Effect</span>
</div>
</div>
<div class="breakdown-section">
<h2 class="section-title">Detailed Breakdown</h2>
<div class="breakdown-grid" id="breakdownGrid"></div>
</div>
</div>
<div class="tooltip" id="tooltip"></div>
<script>
// Pricing data
const pricingData = [
{ id: 'list', name: 'List Price', amount: 1000.00, type: 'start', description: 'Manufacturer suggested retail price' },
{ id: 'std_disc', name: 'Standard Discount', amount: -80.00, type: 'leakage', description: 'Base discount for all customers' },
{ id: 'vol_disc', name: 'Volume Discount', amount: -50.00, type: 'leakage', description: 'Discount for bulk purchasing' },
{ id: 'promo', name: 'Promotional Allowance', amount: -35.00, type: 'leakage', description: 'Marketing and promotion support' },
{ id: 'rebate', name: 'Customer Rebate', amount: -45.00, type: 'leakage', description: 'End-of-period cash back' },
{ id: 'cash_disc', name: 'Cash Payment Discount', amount: -20.00, type: 'leakage', description: 'Early payment incentive (2/10 net 30)' },
{ id: 'freight', name: 'Freight Absorption', amount: -25.00, type: 'leakage', description: 'Shipping cost absorbed by seller' },
{ id: 'returns', name: 'Returns Reserve', amount: -15.00, type: 'leakage', description: 'Expected product returns' },
{ id: 'co_op', name: 'Co-op Advertising', amount: -12.50, type: 'leakage', description: 'Shared advertising costs' },
{ id: 'other', name: 'Other Deductions', amount: -20.00, type: 'leakage', description: 'Miscellaneous price reductions' },
{ id: 'pocket', name: 'Pocket Price', amount: 697.50, type: 'end', description: 'Final realized price after all deductions' }
];
// Calculate running totals
let runningTotal = 0;
const waterfallData = pricingData.map((item, index) => {
const prevTotal = runningTotal;
if (item.type === 'start') {
runningTotal = item.amount;
return { ...item, start: 0, end: item.amount, prevTotal: 0 };
} else if (item.type === 'end') {
return { ...item, start: 0, end: item.amount, prevTotal: runningTotal };
} else {
runningTotal += item.amount;
return { ...item, start: prevTotal, end: runningTotal, prevTotal: prevTotal };
}
});
// SVG setup
const svg = document.getElementById('waterfallChart');
const tooltip = document.getElementById('tooltip');
const container = svg.parentElement;
let width, height, chartWidth, chartHeight, marginLeft, marginBottom, marginTop, marginRight;
let barWidth, barGap;
function setupDimensions() {
const rect = container.getBoundingClientRect();
width = rect.width - 80;
height = 500;
marginLeft = 80;
marginRight = 40;
marginTop = 60;
marginBottom = 100;
chartWidth = width - marginLeft - marginRight;
chartHeight = height - marginTop - marginBottom;
const totalBars = waterfallData.length;
barGap = Math.max(8, chartWidth * 0.02);
barWidth = (chartWidth - (totalBars - 1) * barGap) / totalBars;
barWidth = Math.min(barWidth, 80);
}
const maxValue = Math.max(...waterfallData.map(d => Math.max(d.start, d.end, d.prevTotal)));
function yScale(value) {
return marginTop + chartHeight - (value / maxValue) * chartHeight;
}
function getBarColor(type) {
if (type === 'start') return 'url(#greenGradient)';
if (type === 'end') return 'url(#blueGradient)';
return 'url(#redGradient)';
}
function formatCurrency(value) {
const prefix = value >= 0 ? '' : '-';
return prefix + '$' + Math.abs(value).toFixed(2).replace(/\B(?=(\d{3})+(?!\d))/g, ',');
}
function createGradients() {
const defs = document.createElementNS('http://www.w3.org/2000/svg', 'defs');
const greenGradient = document.createElementNS('http://www.w3.org/2000/svg', 'linearGradient');
greenGradient.setAttribute('id', 'greenGradient');
greenGradient.setAttribute('x1', '0%');
greenGradient.setAttribute('y1', '0%');
greenGradient.setAttribute('x2', '0%');
greenGradient.setAttribute('y2', '100%');
greenGradient.innerHTML = `
<stop offset="0%" style="stop-color:#3fb950"/>
<stop offset="100%" style="stop-color:#2ea043"/>
`;
const redGradient = document.createElementNS('http://www.w3.org/2000/svg', 'linearGradient');
redGradient.setAttribute('id', 'redGradient');
redGradient.setAttribute('x1', '0%');
redGradient.setAttribute('y1', '0%');
redGradient.setAttribute('x2', '0%');
redGradient.setAttribute('y2', '100%');
redGradient.innerHTML = `
<stop offset="0%" style="stop-color:#f85149"/>
<stop offset="100%" style="stop-color:#da3633"/>
`;
const blueGradient = document.createElementNS('http://www.w3.org/2000/svg', 'linearGradient');
blueGradient.setAttribute('id', 'blueGradient');
blueGradient.setAttribute('x1', '0%');
blueGradient.setAttribute('y1', '0%');
blueGradient.setAttribute('x2', '0%');
blueGradient.setAttribute('y2', '100%');
blueGradient.innerHTML = `
<stop offset="0%" style="stop-color:#58a6ff"/>
<stop offset="100%" style="stop-color:#388bfd"/>
`;
defs.appendChild(greenGradient);
defs.appendChild(redGradient);
defs.appendChild(blueGradient);
svg.appendChild(defs);
}
function drawChart() {
svg.innerHTML = '';
setupDimensions();
createGradients();
svg.setAttribute('viewBox', `0 0 ${width} ${height}`);
svg.setAttribute('preserveAspectRatio', 'xMidYMid meet');
// Grid lines
const gridGroup = document.createElementNS('http://www.w3.org/2000/svg', 'g');
for (let i = 0; i <= 5; i++) {
const value = (maxValue / 5) * i;
const y = yScale(value);
const line = document.createElementNS('http://www.w3.org/2000/svg', 'line');
line.setAttribute('x1', marginLeft);
line.setAttribute('y1', y);
line.setAttribute('x2', width - marginRight);
line.setAttribute('y2', y);
line.setAttribute('class', 'grid-line');
gridGroup.appendChild(line);
const label = document.createElementNS('http://www.w3.org/2000/svg', 'text');
label.setAttribute('x', marginLeft - 10);
label.setAttribute('y', y + 4);
label.setAttribute('text-anchor', 'end');
label.setAttribute('class', 'axis-label');
label.textContent = formatCurrency(value);
gridGroup.appendChild(label);
}
svg.appendChild(gridGroup);
// X-axis
const xAxis = document.createElementNS('http://www.w3.org/2000/svg', 'line');
xAxis.setAttribute('x1', marginLeft);
xAxis.setAttribute('y1', marginTop + chartHeight);
xAxis.setAttribute('x2', width - marginRight);
xAxis.setAttribute('y2', marginTop + chartHeight);
xAxis.setAttribute('class', 'axis-line');
svg.appendChild(xAxis);
// Draw bars with animation
waterfallData.forEach((d, i) => {
const group = document.createElementNS('http://www.w3.org/2000/svg', 'g');
group.setAttribute('class', 'bar-group');
group.setAttribute('data-index', i);
const x = marginLeft + i * (barWidth + barGap);
let barTop, barHeight;
if (d.type === 'start') {
barTop = yScale(d.amount);
barHeight = chartHeight - (marginTop + chartHeight - barTop);
} else if (d.type === 'end') {
barTop = yScale(d.amount);
barHeight = chartHeight - (marginTop + chartHeight - barTop);
} else {
barTop = yScale(Math.max(d.start, d.end));
barHeight = Math.abs(yScale(d.start) - yScale(d.end));
}
// Bar rectangle
const rect = document.createElementNS('http://www.w3.org/2000/svg', 'rect');
rect.setAttribute('x', x);
rect.setAttribute('y', barTop);
rect.setAttribute('width', barWidth);
rect.setAttribute('height', 0);
rect.setAttribute('rx', 4);
rect.setAttribute('ry', 4);
rect.setAttribute('fill', getBarColor(d.type));
rect.setAttribute('class', 'bar-rect');
// Animate bar height
setTimeout(() => {
rect.style.transition = 'height 0.8s cubic-bezier(0.4, 0, 0.2, 1)';
rect.setAttribute('height', barHeight);
}, i * 100);
group.appendChild(rect);
// Bar label (name)
const label = document.createElementNS('http://www.w3.org/2000/svg', 'text');
label.setAttribute('x', x + barWidth / 2);
label.setAttribute('y', marginTop + chartHeight + 20);
label.setAttribute('text-anchor', 'middle');
label.setAttribute('class', 'bar-label');
// Split long names
const words = d.name.split(' ');
if (words.length > 2) {
label.innerHTML = `<tspan x="${x + barWidth / 2}" dy="0">${words.slice(0, 2).join(' ')}</tspan><tspan x="${x + barWidth / 2}" dy="12">${words.slice(2).join(' ')}</tspan>`;
} else {
label.textContent = d.name;
}
group.appendChild(label);
// Amount label on bar
const amountLabel = document.createElementNS('http://www.w3.org/2000/svg', 'text');
amountLabel.setAttribute('x', x + barWidth / 2);
amountLabel.setAttribute('y', barTop - 8);
amountLabel.setAttribute('text-anchor', 'middle');
amountLabel.setAttribute('class', 'bar-amount');
amountLabel.setAttribute('fill', d.type === 'leakage' ? '#f85149' : '#3fb950');
amountLabel.textContent = formatCurrency(Math.abs(d.amount));
amountLabel.style.opacity = '0';
setTimeout(() => {
amountLabel.style.transition = 'opacity 0.5s';
amountLabel.style.opacity = '1';
}, i * 100 + 500);
group.appendChild(amountLabel);
// Connector line to next bar
if (i < waterfallData.length - 1 && d.type !== 'end') {
const nextD = waterfallData[i + 1];
const connector = document.createElementNS('http://www.w3.org/2000/svg', 'line');
connector.setAttribute('x1', x + barWidth);
connector.setAttribute('y1', yScale(d.end || d.amount));
connector.setAttribute('x2', x + barWidth + barGap);
connector.setAttribute('y2', yScale(d.end || d.amount));
connector.setAttribute('class', 'connector-line');
connector.style.opacity = '0';
setTimeout(() => {
connector.style.transition = 'opacity 0.5s';
connector.style.opacity = '0.6';
}, i * 100 + 300);
group.appendChild(connector);
}
// Event listeners
group.addEventListener('mouseenter', (e) => showTooltip(e, d, i));
group.addEventListener('mousemove', (e) => moveTooltip(e));
group.addEventListener('mouseleave', hideTooltip);
svg.appendChild(group);
});
}
function showTooltip(e, d, index) {
const percentOfList = ((Math.abs(d.amount) / 1000) * 100).toFixed(1);
tooltip.innerHTML = `
<div class="tooltip-title">${d.name}</div>
<div class="tooltip-row">
<span class="tooltip-label">Amount:</span>
<span class="tooltip-value ${d.type === 'leakage' ? 'negative' : 'positive'}">${formatCurrency(d.amount)}</span>
</div>
<div class="tooltip-row">
<span class="tooltip-label">% of List:</span>
<span class="tooltip-value">${percentOfList}%</span>
</div>
<div class="tooltip-row">
<span class="tooltip-label">Description:</span>
<span class="tooltip-value" style="color: #8b949e; font-weight: normal; text-align: right; max-width: 150px;">${d.description}</span>
</div>
`;
tooltip.classList.add('visible');
moveTooltip(e);
}
function moveTooltip(e) {
const x = e.clientX + 15;
const y = e.clientY + 15;
const rect = tooltip.getBoundingClientRect();
let finalX = x;
let finalY = y;
if (x + rect.width > window.innerWidth) {
finalX = e.clientX - rect.width - 15;
}
if (y + rect.height > window.innerHeight) {
finalY = e.clientY - rect.height - 15;
}
tooltip.style.left = finalX + 'px';
tooltip.style.top = finalY + 'px';
}
function hideTooltip() {
tooltip.classList.remove('visible');
}
function renderBreakdown() {
const grid = document.getElementById('breakdownGrid');
const listPrice = 1000;
grid.innerHTML = pricingData.map(d => {
const percentOfList = ((Math.abs(d.amount) / listPrice) * 100).toFixed(1);
return `
<div class="breakdown-item ${d.type}">
<div class="breakdown-name">${d.name}</div>
<div class="breakdown-amount">${formatCurrency(d.amount)}</div>
<div class="breakdown-percent">${percentOfList}% of List Price</div>
</div>
`;
}).join('');
}
function createParticles() {
const container = document.getElementById('particles');
const particleCount = 30;
for (let i = 0; i < particleCount; i++) {
const particle = document.createElement('div');
particle.className = 'particle';
particle.style.left = Math.random() * 100 + '%';
particle.style.top = Math.random() * 100 + '%';
particle.style.animationDelay = Math.random() * 8 + 's';
particle.style.animationDuration = (6 + Math.random() * 4) + 's';
particle.style.width = (2 + Math.random() * 3) + 'px';
particle.style.height = particle.style.width;
const colors = ['#58a6ff', '#3fb950', '#f0883e', '#a371f7'];
particle.style.background = colors[Math.floor(Math.random() * colors.length)];
container.appendChild(particle);
}
}
// Initialize
window.addEventListener('load', () => {
createParticles();
drawChart();
renderBreakdown();
});
window.addEventListener('resize', () => {
drawChart();
});
</script>
</body>
</html>
Key Features:
-
Interactive Waterfall Chart
- Sequential bars showing the flow from List Price (1,000)toPocketPrice(697.50)
- Connecting dashed lines between bars showing the cumulative effect
- Hover tooltips with detailed information about each component
-
Visual Design
- Dark professional theme with green for positive values, red for leakages
- Gradient fills on bars for depth
- Floating particle background for visual interest
- Smooth staggered animations on load
-
Metrics Dashboard
- Quick view of List Price, Total Leakage, Pocket Price, and Leakage Rate
- Color-coded values for instant comprehension
-
Detailed Breakdown Section
- Card-based layout showing each component
- Percentage of list price for each item
- Color-coded borders matching the chart
-
Responsive Design
- Adapts to different screen sizes
- Touch-friendly interactions