Open
Description
Im trying to program a spending limit with rounded corners and my current chart is this:
I use a horizontal bar chart which is split into spent and remaining, assigned values here:
val barChart = HorizontalBarChart(LocalContext.current)
val entries = listOf(
BarEntry(0f, floatArrayOf(spent, remaining))
)
val dataSet = BarDataSet(entries, "").apply {
colors = listOf(spentColor, Color.rgb(64, 64, 64)) // Spent color and remaining color
valueTextColor = Color.WHITE
valueTextSize = 16f
setDrawValues(false) // Hide the value labels on the bars
}
However, when setting the renderer like here:
renderer = RoundedHorizontalBarChartRenderer(this, ChartAnimator(), ViewPortHandler())
(renderer as RoundedHorizontalBarChartRenderer).setRoundedPositiveDataSetRadius(20f) // Set the corner radius
as needed

The bar chart is loaded in as I can highlight it however there is no color at all, it is the same color as the background (commenting out setting the custom renderer fixes this)
I think the RoundedHorizontalBarChartRenderer doesn't work with split bar charts. If this is not the case if someone can let me know what I am doing wrong, if it is the case then I would be happy to give a go fixing it.
Metadata
Metadata
Assignees
Labels
No labels