Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
alvarohghg opened this issue Mar 31, 2024 · 3 comments
Open

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

alvarohghg opened this issue Mar 31, 2024 · 3 comments
Labels
enhancement New feature or request

Comments

@alvarohghg
Copy link

alvarohghg commented Mar 31, 2024

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 AAChartModel added the enhancement New feature or request label Apr 1, 2024
@AAChartModel
Copy link
Owner

        val aaOptions = aaChartModel.aa_toAAOptions()

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

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

@alvarohghg
Copy link
Author

alvarohghg commented Apr 2, 2024

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
Copy link
Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants