Set priceFormat precision 0 for LineSeries and BaselineSeries to hide decimals

This commit is contained in:
DiTus
2026-03-18 23:06:10 +01:00
parent cbba89ef0f
commit dd53b13979

View File

@ -911,28 +911,30 @@ function renderIndicatorOnPane(indicator, meta, instance, candles, paneIndex, li
lastValueVisible: false lastValueVisible: false
}, paneIndex); }, paneIndex);
} else if (plot.type === 'baseline') { } else if (plot.type === 'baseline') {
series = window.dashboard.chart.addSeries(LightweightCharts.BaselineSeries, { series = window.dashboard.chart.addSeries(LightweightCharts.BaselineSeries, {
baseValue: { type: 'price', price: plot.baseValue || 0 }, baseValue: { type: 'price', price: plot.baseValue || 0 },
topLineColor: plot.topLineColor || plotColor, topLineColor: plot.topLineColor || plotColor,
topFillColor1: plot.topFillColor1 || plotColor, topFillColor1: plot.topFillColor1 || plotColor,
topFillColor2: '#00000000', topFillColor2: '#00000000',
bottomFillColor1: '#00000000', bottomFillColor1: '#00000000',
bottomColor: plot.bottomColor || '#00000000', bottomColor: plot.bottomColor || '#00000000',
lineWidth: plot.width || indicator.params._lineWidth || lineWidth, lineWidth: plot.width || indicator.params._lineWidth || lineWidth,
lineStyle: plotLineStyle, lineStyle: plotLineStyle,
title: plot.title || '', title: plot.title || '',
priceLineVisible: false, priceLineVisible: false,
lastValueVisible: plot.lastValueVisible !== false lastValueVisible: plot.lastValueVisible !== false,
}, paneIndex); priceFormat: { type: 'price', precision: 0, minMove: 1 }
}, paneIndex);
} else { } else {
series = window.dashboard.chart.addSeries(LightweightCharts.LineSeries, { series = window.dashboard.chart.addSeries(LightweightCharts.LineSeries, {
color: plotColor, color: plotColor,
lineWidth: plot.width || indicator.params._lineWidth || lineWidth, lineWidth: plot.width || indicator.params._lineWidth || lineWidth,
lineStyle: plotLineStyle, lineStyle: plotLineStyle,
title: '', title: '',
priceLineVisible: false, priceLineVisible: false,
lastValueVisible: plot.lastValueVisible !== false lastValueVisible: plot.lastValueVisible !== false,
}, paneIndex); priceFormat: { type: 'price', precision: 0, minMove: 1 }
}, paneIndex);
} }
series.setData(data); series.setData(data);