fix: Add debug logging for auto scale button

This commit is contained in:
DiTus
2026-03-21 07:52:29 +01:00
parent 3ec2e41da7
commit 3bdec3251d

View File

@ -511,14 +511,21 @@ constructor() {
}; };
btnAutoScale.addEventListener('click', () => { btnAutoScale.addEventListener('click', () => {
console.log('[AutoScale] Button clicked');
console.log('[AutoScale] candleSeries:', this.candleSeries);
console.log('[AutoScale] priceScale():', this.candleSeries?.priceScale());
this.priceScaleState.autoScale = !this.priceScaleState.autoScale; this.priceScaleState.autoScale = !this.priceScaleState.autoScale;
btnAutoScale.classList.toggle('active', this.priceScaleState.autoScale); btnAutoScale.classList.toggle('active', this.priceScaleState.autoScale);
try {
this.candleSeries.priceScale().applyOptions({ this.candleSeries.priceScale().applyOptions({
autoScale: this.priceScaleState.autoScale autoScale: this.priceScaleState.autoScale
}); });
console.log('[AutoScale] Success:', this.priceScaleState.autoScale ? 'ON' : 'OFF');
console.log('Auto Scale:', this.priceScaleState.autoScale ? 'ON' : 'OFF'); } catch (e) {
console.error('[AutoScale] Error:', e.message);
}
}); });
btnLogScale.addEventListener('click', () => { btnLogScale.addEventListener('click', () => {