示例工程 21-data-report
21-data-report/app/assets/chart.svg
点击「运行示例」后,左侧显示源码、右侧显示运行结果;console 输出会实时回传。
<svg xmlns="http://www.w3.org/2000/svg" width="720" height="360" viewBox="0 0 720 360">
<rect width="720" height="360" fill="#ffffff"/>
<line x1="70" y1="300" x2="680" y2="300" stroke="#cbd5e1" stroke-width="2"/>
<rect x="120" y="200" width="80" height="100" fill="#93c5fd"/>
<rect x="280" y="160" width="80" height="140" fill="#60a5fa"/>
<rect x="440" y="110" width="80" height="190" fill="#3b82f6"/>
<rect x="600" y="70" width="80" height="230" fill="#2563eb"/>
<text x="160" y="330" font-family="system-ui, sans-serif" font-size="18" fill="#475569" text-anchor="middle">Q1</text>
<text x="320" y="330" font-family="system-ui, sans-serif" font-size="18" fill="#475569" text-anchor="middle">Q2</text>
<text x="480" y="330" font-family="system-ui, sans-serif" font-size="18" fill="#475569" text-anchor="middle">Q3</text>
<text x="640" y="330" font-family="system-ui, sans-serif" font-size="18" fill="#475569" text-anchor="middle">Q4</text>
<text x="70" y="42" font-family="system-ui, sans-serif" font-size="20" fill="#0f172a">季度访问量</text>
</svg>