Fix line width slider to respect user settings
Changed line width priority from plot.width (metadata default) to indicator.params._lineWidth (user setting). Now when user changes line width via slider, the chart properly updates to use the user's specified width instead of the hardcoded plot.width=1 from metadata. Also added immediate visual feedback to slider with nextElementSibling.textContent update.
This commit is contained in:
@ -290,7 +290,7 @@ return `
|
|||||||
|
|
||||||
<div class="config-row">
|
<div class="config-row">
|
||||||
<label>Line Width</label>
|
<label>Line Width</label>
|
||||||
<input type="range" min="1" max="5" value="${indicator.params._lineWidth || 2}" onchange="window.updateIndicatorSetting && window.updateIndicatorSetting('${indicator.id}', '_lineWidth', parseInt(this.value))">
|
<input type="range" min="1" max="5" value="${indicator.params._lineWidth || 2}" onchange="this.nextElementSibling.textContent = this.value; window.updateIndicatorSetting && window.updateIndicatorSetting('${indicator.id}', '_lineWidth', parseInt(this.value))">
|
||||||
<span class="range-value">${indicator.params._lineWidth || 2}</span>
|
<span class="range-value">${indicator.params._lineWidth || 2}</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -695,7 +695,7 @@ function renderIndicatorOnPane(indicator, meta, instance, candles, paneIndex, li
|
|||||||
topFillColor2: '#00000000',
|
topFillColor2: '#00000000',
|
||||||
bottomFillColor1: '#00000000',
|
bottomFillColor1: '#00000000',
|
||||||
bottomColor: plot.bottomColor || '#00000000',
|
bottomColor: plot.bottomColor || '#00000000',
|
||||||
lineWidth: plot.width !== undefined ? plot.width : lineWidth,
|
lineWidth: indicator.params._lineWidth || plot.width || lineWidth,
|
||||||
lineStyle: plotLineStyle,
|
lineStyle: plotLineStyle,
|
||||||
title: plot.title || '',
|
title: plot.title || '',
|
||||||
priceLineVisible: false,
|
priceLineVisible: false,
|
||||||
@ -704,7 +704,7 @@ function renderIndicatorOnPane(indicator, meta, instance, candles, paneIndex, li
|
|||||||
} else {
|
} else {
|
||||||
series = window.dashboard.chart.addSeries(LightweightCharts.LineSeries, {
|
series = window.dashboard.chart.addSeries(LightweightCharts.LineSeries, {
|
||||||
color: plotColor,
|
color: plotColor,
|
||||||
lineWidth: plot.width !== undefined ? plot.width : lineWidth,
|
lineWidth: indicator.params._lineWidth || plot.width || lineWidth,
|
||||||
lineStyle: plotLineStyle,
|
lineStyle: plotLineStyle,
|
||||||
title: plot.title || '',
|
title: plot.title || '',
|
||||||
priceLineVisible: false,
|
priceLineVisible: false,
|
||||||
|
|||||||
Reference in New Issue
Block a user