Fix syntax error and add price format selector listener

This commit is contained in:
DiTus
2026-03-18 23:23:10 +01:00
parent 406c3d7b95
commit e47b9cd5c3

View File

@ -313,27 +313,28 @@ constructor() {
return TimezoneConfig.formatTickMark(time);
},
},
localization: {
localization: {
timeFormatter: (timestamp) => {
return TimezoneConfig.formatDate(timestamp * 1000);
},
},
handleScroll: {
// Setup price format selector change handler
const priceSelect = document.getElementById("priceFormatSelect");
if (priceSelect) {
priceSelect.addEventListener("change", (e) => {
const precision = parseInt(e.target.value);
this.chart.priceScale().applyOptions({
priceFormat: { type: "price", precision: precision, minMove: precision===0 ? 1 : 0.0001 }
});
});
}
vertTouchDrag: false,
},
});
this.candleSeries = this.chart.addSeries(LightweightCharts.CandlestickSeries, {
vertTouchDrag: false,
},
});
// Setup price format selector change handler
const priceSelect = document.getElementById("priceFormatSelect");
if (priceSelect) {
priceSelect.addEventListener("change", (e) => {
const precision = parseInt(e.target.value);
this.chart.priceScale().applyOptions({
priceFormat: { type: "price", precision: precision, minMove: precision===0 ? 1 : 0.0001 }
});
});
}
this.candleSeries = this.chart.addSeries(LightweightCharts.CandlestickSeries, {
upColor: '#ff9800',
downColor: '#ff9800',
borderUpColor: '#ff9800',