applyLine() refactor/fix
This commit is contained in:
@@ -27,7 +27,6 @@ function changeSymbol(symbol) {
|
||||
lastSymbolChangedArgs = info
|
||||
symbolChangedCbs.forEach((cb)=>cb(info))
|
||||
co.selectedSymbol = info
|
||||
co.meanRange = chartMeanRange()
|
||||
}
|
||||
|
||||
|
||||
@@ -36,6 +35,13 @@ function changeInterval(interval, _timeframe) {
|
||||
}
|
||||
|
||||
|
||||
function dataLoaded() {
|
||||
const range = chartMeanRange()
|
||||
console.log('new mean range', range)
|
||||
co.meanRange = range
|
||||
}
|
||||
|
||||
|
||||
/* TradingView event keystrings
|
||||
const subscribeEvents = [
|
||||
'toggle_sidebar', 'indicators_dialog', 'toggle_header', 'edit_object_dialog', 'chart_load_requested',
|
||||
@@ -83,6 +89,7 @@ function initChart() {
|
||||
chart.crossHairMoved().subscribe(null, (point)=>setTimeout(()=>handleCrosshairMovement(point),0) )
|
||||
chart.onSymbolChanged().subscribe(null, changeSymbol)
|
||||
chart.onIntervalChanged().subscribe(null, changeInterval)
|
||||
chart.onDataLoaded().subscribe(null, dataLoaded)
|
||||
const tzapi = chart.getTimezoneApi();
|
||||
tzapi.onTimezoneChanged().subscribe(null, (tz)=>{if (tz==='exchange') tz='Etc/UTC'; s.timeZone=tz})
|
||||
s.timeZone = tzapi.getTimezone().id
|
||||
|
||||
Reference in New Issue
Block a user