MCPcopy
hub / github.com/klinecharts/KLineChart / mountChart

Function mountChart

debug/main.js:182–203  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

180}
181
182function mountChart () {
183 const chartDom = document.getElementById('chart')
184 if (chartDom === null) {
185 return
186 }
187 dispose(chartDom)
188 chart = init(chartDom, {
189 layout: {
190 basicParams: {
191 // yAxisPosition: 'left',
192 // paneHeight: 200
193 },
194 panes: [{ type: 'candle' }, { type: 'indicator', content: ['MA'] }]
195 }
196 })
197 chart.setSymbol({ ticker: 'DEBUG', pricePrecision: 2, volumePrecision: 0 })
198 chart.setPeriod(getActivePeriodConfig().period)
199 chart.setDataLoader(createDataLoader())
200 chart.createIndicator('EMA', { pane: { id: 'candle_pane' }, yAxis: { id: 'new' } })
201
202 // chart.createOverlay('brush')
203}
204
205function bindToolbar () {
206 document.querySelectorAll('#period-switcher button').forEach(periodButton => {

Callers 1

main.jsFile · 0.85

Calls 8

disposeFunction · 0.90
initFunction · 0.90
getActivePeriodConfigFunction · 0.85
createDataLoaderFunction · 0.85
createIndicatorMethod · 0.80
setSymbolMethod · 0.45
setPeriodMethod · 0.45
setDataLoaderMethod · 0.45

Tested by

no test coverage detected