AAChartCore-Kotlin
AAChartCore-Kotlin copied to clipboard
How can I change the size of the font of the xAxis and yAxis?
I'm trying to make a responsive app for phones and tablets but the font is too small for tablets and I cannot see any option that allows changing the font size (apart from the title and subtitle) so my chart looks like this on tablets:
My code is like this:
val aaChartModelGrafica : AAChartModel = AAChartModel()
.chartType(AAChartType.Bar)
.title("DÃas de actividad de $asignaturaSeleccionada")
.titleStyle(
AAStyle()
.color("#0D6277")
.fontSize(titleSize)
)
.backgroundColor("#d8fcf2")
.colorsTheme(arrayOf("#f13e71", "#d8fcf2", "#06caf4", "#7dffc0"))
.dataLabelsEnabled(true)
.xAxisReversed(true)
.zoomType(AAChartZoomType.XY)
.yAxisTitle("Minutos estudiados")
.categories(dataGrafica.map { it.first }.toTypedArray())
.series(arrayOf(
AASeriesElement()
.name("Minutos")
.data(dataGrafica.map { it.second }.toTypedArray()))
)
val aaOptions = aaChartModel.aa_toAAOptions()
aaOptions.xAxis?.labels
?.style(AAStyle.style(AAColor.Black, 18))
aaOptions.yAxis?.labels
?.style(AAStyle.style(AAColor.Black, 18))
I've already tried that but doesn't even change the colors. I have established very big fonts and a different color (Red) for both axis you can see that is not working. Here's my code and the chart:
okay, I have realized that the problem is that I was not applying the method aa_drawChartWithChartOptions to apply the configuration. Now it works!