AAChartModel / AAChartCore-Kotlin

📈📊⛰⛰⛰An elegant modern declarative data visualization chart framework for Android . Extremely powerful, supports line, spline, area, areaspline, column, bar, pie, scatter, angular gauges, arearange, areasplinerange, columnrange, bubble, box plot, error bars, funnel, waterfall and polar chart types.极其精美而又强大的 Android 数据可视化图表框架,支持柱状图、条形图、折线图、曲线图、折线填充图、曲线填充图、气泡图、扇形图、环形图、散点图、雷达图、混合图等各种类型的多达几十种的信息图图表,完全满足工作所需.
Apache License 2.0
1.02k stars 118 forks source link

How can I change the size of the font of the xAxis and yAxis? #202

Open alvarohghg opened 7 months ago

alvarohghg commented 7 months ago

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:

Captura

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()))
            )
AAChartModel commented 7 months ago
        val aaOptions = aaChartModel.aa_toAAOptions()

        aaOptions.xAxis?.labels
            ?.style(AAStyle.style(AAColor.Black, 18))

        aaOptions.yAxis?.labels
            ?.style(AAStyle.style(AAColor.Black, 18))
alvarohghg commented 7 months ago

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: image

alvarohghg commented 7 months ago

okay, I have realized that the problem is that I was not applying the method aa_drawChartWithChartOptions to apply the configuration. Now it works! image