File tree Expand file tree Collapse file tree 2 files changed +3
-2
lines changed
compose-charts/src/commonMain/kotlin/ir/ehsannarmani/compose_charts Expand file tree Collapse file tree 2 files changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -370,7 +370,7 @@ fun ColumnChart(
370370 val minLabelWidth = labelWidths.min()
371371
372372 var textModifier: Modifier = Modifier
373- var shouldRotate = false
373+ var shouldRotate = labelProperties.forceRotation
374374 if ((maxLabelWidth / minLabelWidth.toDouble()) >= 1.5 ) {
375375 textModifier = textModifier.width((minLabelWidth / density.density).dp)
376376 shouldRotate = true
@@ -391,7 +391,7 @@ fun ColumnChart(
391391 - (labelMeasures[index].size.width - minLabelWidth.toFloat()) - minLabelWidth / 2
392392 } else textModifier,
393393 text = bar.label,
394- style = labelProperties.textStyle.copy() ,
394+ style = labelProperties.textStyle,
395395 overflow = TextOverflow .Visible ,
396396 softWrap = false ,
397397 )
Original file line number Diff line number Diff line change @@ -12,4 +12,5 @@ data class LabelProperties(
1212 val padding : Dp = 12 .dp,
1313 val labels : List <String > = listOf(),
1414 val rotationDegreeOnSizeConflict : Float = -45f ,
15+ val forceRotation : Boolean = false ,
1516)
You can’t perform that action at this time.
0 commit comments