layout misalignment on bar ColumnChart
Hello, Thanks for this awesome library. I enjoy using it so much.
I am currently facing an issue where the numbers in the vertical line is misalinging with the vertical line as shown by the picture. Is this fixable. I will provide code to reproduce it later if needed
Hi @jossephus , please provide your code.
Hi. Thanks for replying fast. Here is my code using custom list values. Although these values are exactly the ones i am getting from my api request, the problem doesnt happen anymore when i do this. I think it is weird
Column(
modifier = Modifier
.fillMaxSize()
.padding(top = 16.dp),
horizontalAlignment = Alignment.CenterHorizontally
) {
val chartColors = listOf(
Color(0xFF0AB39C),
Color(0xFF405189),
Color(0xFFF06548)
)
var earnings = listOf(
2250,
1200,
1000,
)
Card(
modifier = Modifier
.padding(top = 5.dp, start = 10.dp, end = 10.dp)
.fillMaxWidth()
.surface(
shape = MaterialTheme.shapes.extraSmall,
backgroundColor = MaterialTheme.colorScheme.surface,
border = null,
shadowElevation = 2.dp
)
.padding(start = 10.dp, end = 10.dp, bottom = 10.dp),
colors = CardDefaults.cardColors(
containerColor = Color.Transparent
),
shape = MaterialTheme.shapes.medium
) {
ColumnChart(
modifier = Modifier
.height(200.dp)
.padding(top = 3.dp, bottom = 15.dp, start = 22.dp, end = 22.dp),
gridProperties = GridProperties(
enabled = false,
),
labelProperties = LabelProperties(
enabled = false,
),
data = listOf(
Bars(
label = "",
values = listOf(
Bars.Data(
value = earnings[0].toDouble()
?: 0.0,
color = SolidColor(chartColors[0]),
),
)
),
Bars(
label = "",
values = listOf(
Bars.Data(
label = null,
value = (earnings[1].toDouble() ?: 0.0),
color = SolidColor(chartColors[1])
),
)
),
Bars(
label = "",
values = listOf(
Bars.Data(
value = earnings[2].toDouble()
?: 0.0,
color = SolidColor(chartColors[2])
),
)
),
),
barProperties = BarProperties(
cornerRadius = Bars.Data.Radius.Rectangle(
topRight = 6.dp,
topLeft = 6.dp
),
spacing = 30.dp,
thickness = 50.dp,
),
animationSpec = spring(
dampingRatio = Spring.DampingRatioMediumBouncy,
stiffness = Spring.StiffnessLow
),
labelHelperProperties = LabelHelperProperties(
enabled = false,
)
)
}
}
@jossephus Which version of the library you are using?
I am using "0.0.17". (sorry for the late reply)
Please test 0.1.0 version and let me notified if issue still exists.
Hi @ehsannarmani , I have tested this issue in latest version 0.1.0 Issue is not replicating. Attaching screenshots.
@jossephus please confirm.
Hi @yashwanthgajji sorry for the taking too much to reply. This worked after updating to 0.1.0 and i havent had any reported issue since then. Thanks