Fix syntax error and add price format selector listener
This commit is contained in:
@ -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',
|
||||
|
||||
Reference in New Issue
Block a user