| 1 | <!DOCTYPE html> |
| 2 | <html lang="zh-CN"><head><meta charset="utf-8"><title>Chart · Bar</title> |
| 3 | <link rel="stylesheet" href="../../assets/fonts.css"> |
| 4 | <link rel="stylesheet" href="../../assets/base.css"> |
| 5 | <link rel="stylesheet" id="theme-link" href="../../assets/themes/minimal-white.css"> |
| 6 | <link rel="stylesheet" href="../../assets/animations/animations.css"> |
| 7 | <script src="https://cdn.jsdelivr.net/npm/chart.js@4.4.3/dist/chart.umd.min.js"></script> |
| 8 | </head><body class="single"> |
| 9 | <div class="deck"><section class="slide is-active" data-title="Bar chart"> |
| 10 | <p class="kicker">Chart · 柱状图</p> |
| 11 | <h2 class="h2">季度 MRR 趋势</h2> |
| 12 | <div class="card mt-l" style="height:520px;padding:28px"><canvas id="c"></canvas></div> |
| 13 | <script> |
| 14 | addEventListener('DOMContentLoaded',()=>{ |
| 15 | const css=getComputedStyle(document.documentElement); |
| 16 | const accent=css.getPropertyValue('--accent').trim(); |
| 17 | const text2=css.getPropertyValue('--text-2').trim(); |
| 18 | const border=css.getPropertyValue('--border').trim(); |
| 19 | new Chart(document.getElementById('c'),{type:'bar', |
| 20 | data:{labels:['Q1','Q2','Q3','Q4','Q1 +1','Q2 +1','Q3 +1','Q4 +1'], |
| 21 | datasets:[{label:'MRR (K)',data:[42,58,73,96,124,158,204,261], |
| 22 | backgroundColor:accent,borderRadius:8,barThickness:36}]}, |
| 23 | options:{plugins:{legend:{labels:{color:text2}}}, |
| 24 | scales:{x:{ticks:{color:text2},grid:{color:border}}, |
| 25 | y:{ticks:{color:text2},grid:{color:border}}}}}); |
| 26 | }); |
| 27 | </script> |
| 28 | </section></div> |
| 29 | <script src="../../assets/runtime.js"></script> |
| 30 | </body></html> |
| 31 |