Loading source
Pulling the file list, source metadata, and syntax-aware rendering for this listing.
Source from repo
Generate TradingView-style dark-theme candlestick charts with RSI, MACD, Bollinger Bands, and EMA/SMA using mplfinance.
Files
Skill
Size
Entrypoint
Format
Open file
Syntax-highlighted preview of this file as included in the skill package.
templates/dual-axis.html
1<!DOCTYPE html>2<html lang="en">3<head>4<meta charset="UTF-8">5<meta name="viewport" content="width=device-width, initial-scale=1.0">6<title>Dual Axis Chart</title>7<script src="https://cdn.jsdelivr.net/npm/echarts@5/dist/echarts.min.js"></script>8<style>{{BASE_STYLES}}</style>9</head>10<body>11<div class="toolbar">12<div>13<h1>{{TITLE}}</h1>14<div class="subtitle">{{SUBTITLE}}</div>15</div>16<div class="actions">17<button onclick="downloadPNG(this)">๐ฅ Download PNG</button>18<button onclick="copyToClipboard(this)">๐ Copy Image</button>19<button onclick="saveToProject(this)">๐พ Save Image</button>20</div>21</div>2223<div id="chart-area">24<div id="main-chart" style="width:100%;height:480px;"></div>25</div>2627<script>{{BASE_EXPORT_JS}}</script>28<script>29// === DATA ===30// Left axis: large-scale values (e.g. total market cap in trillions)31// Right axis: small-scale values (e.g. stablecoin supply in billions)32const categories = ['Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec'];33const leftSeries = {34name: 'Total Market Cap ($T)',35data: [1.8, 1.6, 1.9, 2.1, 2.4, 2.2, 2.6, 2.8, 3.0, 2.9, 3.2, 3.5],36};37const rightSeries = {38name: 'Stablecoin Supply ($B)',39data: [130, 128, 132, 135, 138, 140, 143, 145, 148, 150, 153, 156],40};4142// === CHART ===43window.CHART_INSTANCES = [];44const chart = echarts.init(document.getElementById('main-chart'), 'dark');45chart.setOption({46backgroundColor: 'transparent',47tooltip: {48trigger: 'axis',49axisPointer: { type: 'cross' },50},51legend: { top: 8 },52grid: { top: 50, right: 80, bottom: 50, left: 70 },53xAxis: {54type: 'category',55data: categories,56boundaryGap: false,57axisLine: { lineStyle: { color: '#444' } },58},59yAxis: [60{61type: 'value',62name: leftSeries.name,63nameLocation: 'middle',64nameGap: 55,65nameTextStyle: { color: '#5470c6', fontSize: 12 },66axisLabel: { color: '#5470c6', formatter: v => `$${v}T` },67splitLine: { lineStyle: { color: '#2a2d3a' } },68},69{70type: 'value',71name: rightSeries.name,72nameLocation: 'middle',73nameGap: 60,74nameTextStyle: { color: '#91cc75', fontSize: 12 },75axisLabel: { color: '#91cc75', formatter: v => `$${v}B` },76splitLine: { show: false },77},78],79dataZoom: [{ type: 'inside' }, { type: 'slider', height: 20, bottom: 5 }],80series: [81{82name: leftSeries.name,83type: 'line',84yAxisIndex: 0,85data: leftSeries.data,86smooth: true,87symbol: 'circle',88symbolSize: 6,89lineStyle: { width: 2.5, color: '#5470c6' },90itemStyle: { color: '#5470c6' },91areaStyle: { opacity: 0.08, color: '#5470c6' },92},93{94name: rightSeries.name,95type: 'line',96yAxisIndex: 1,97data: rightSeries.data,98smooth: true,99symbol: 'circle',100symbolSize: 6,101lineStyle: { width: 2.5, color: '#91cc75' },102itemStyle: { color: '#91cc75' },103areaStyle: { opacity: 0.08, color: '#91cc75' },104},105],106});107108CHART_INSTANCES.push(chart);109</script>110</body>111</html>112