I'm using the 'com.tradingview:lightweightcharts:4.0.0' library for charting in android kotlin.
I want to implement a feature where when a user interacts with the chart by clicking or holding, the right side of the chart changes color to gray or becomes partially transparent.
What I want to achieve : image
this is method where I am detecting the moving points.
private var curSeries: SeriesApi? = null
chartsVAPI.subscribeCrosshairMove { param -> }
private fun setChartData(a: List<LineData>) {
curSeries?.setData(a)
chartsVAPI.timeScale.fitContent()
}
chartsVAPI.addAreaSeries(
options = areaSeriesOptions {
priceScaleId = PriceScaleId.RIGHT
lineColor = IntColor(resources.getColor(R.color.line_upper, theme))
topColor = IntColor(resources.getColor(R.color.red_upper, theme))
bottomColor = IntColor(resources.getColor(R.color.red, theme))
priceLineVisible = false
title = "2%"
},
onSeriesCreated = { series ->
curSeries = series
setChartData(listCustomPrice)
}
)
I have also tried plugins but not sure how to use it.