(candleCount: number)
| 69 | |
| 70 | // Get appropriate dataZoom config based on candle count |
| 71 | function getDataZoomConfig(candleCount: number) { |
| 72 | if (candleCount <= 200) { |
| 73 | // Few candles: just inside zoom, show all data |
| 74 | return [{ type: 'inside' }]; |
| 75 | } else { |
| 76 | // Many candles: add slider and zoom to recent data |
| 77 | const showPercent = Math.min(100, Math.max(5, 500 / candleCount * 100)); |
| 78 | return [ |
| 79 | { type: 'inside' }, |
| 80 | { type: 'slider', start: 100 - showPercent, end: 100 }, |
| 81 | ]; |
| 82 | } |
| 83 | } |
| 84 | |
| 85 | // Get max candles based on current count (allow some growth for streaming) |
| 86 | function getMaxCandles(candleCount: number): number { |
no outgoing calls
no test coverage detected