Three_CAGR = html`
<div style="font-family: sans-serif; width: 700px; padding: 20px;">
<div style="margin-bottom: 12px;">
<h3 style="margin: 0 0 8px; font-weight: 600;">
Scripbox Equity Portfolio vs Nifty 50 TRI: Over Last 3 Years
</h3>
<div style="display: flex; gap: 20px; font-size: 14px; align-items: center;">
<div style="display: flex; align-items: center;">
<span style="display:inline-block;width:14px;height:14px;background:#F68927;margin-right:6px;border-radius:3px;"></span>
Scripbox Equity
</div>
<div style="display: flex; align-items: center;">
<span style="display:inline-block;width:14px;height:14px;background:#6699dd;margin-right:6px;border-radius:3px;"></span>
Nifty 50 TRI
</div>
</div>
</div>
${Plot.plot({
marks: [
Plot.barY(barData, {
x: "label",
y: "value",
fill: d => d.color ?? "transparent",
fillOpacity: d => d.value === null ? 0 : 1,
width: 0.7
}),
Plot.text(barData.filter(d => d.value !== null), {
x: "label",
y: d => d.value + 0.5,
text: d => `${d.value.toFixed(1)}%`,
fontWeight: "bold",
textAnchor: "middle",
dy: -4
})
],
x: {
label: null
},
y: {
label: null,
tickFormat: d => `${d}%`,
domain: [0, 25]
},
width: 640,
height: 360,
marginBottom: 50
})}
</div>
`