From 752482edd11879fcee296a3bfd741542c8bc22e8 Mon Sep 17 00:00:00 2001 From: Ankur Jain Date: Fri, 2 Aug 2024 16:43:06 -0700 Subject: [PATCH] Fix the title when drag ends. In current code, the last focussed bar label becomes the title when drag is finished. --- .../io/github/dautovicharis/charts/BarStackedChartView.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/charts/src/commonMain/kotlin/io/github/dautovicharis/charts/BarStackedChartView.kt b/charts/src/commonMain/kotlin/io/github/dautovicharis/charts/BarStackedChartView.kt index f7ff8f6..7f130c6 100644 --- a/charts/src/commonMain/kotlin/io/github/dautovicharis/charts/BarStackedChartView.kt +++ b/charts/src/commonMain/kotlin/io/github/dautovicharis/charts/BarStackedChartView.kt @@ -73,7 +73,7 @@ private fun ChartContent(dataSet: MultiChartDataSet, style: StackedBarChartStyle colors = colors ) { selectedIndex -> title = when (selectedIndex) { - NO_SELECTION -> title + NO_SELECTION -> dataSet.data.title else -> { dataSet.data.items[selectedIndex].label }