Not sure how to label the x-axis items
Creating a graph of type Column, and the Y axis values are labeled, and the X axis values show properly (the correct number of items and the correct values associated with each item), but I cannot figure out how to label them as the Y axis values are labeled.
I would like to know how to customize the values shown on the X axis too. Can a series be applied to X axis values? Thanks!
Found this which seems to answer my question: https://github.com/AAChartModel/AAChartKit-Swift/issues/83#issuecomment-422625259
Use .categories(arrayOf("label1", "label2", "label")) when you initialize your AAChartModel().
You can then use .xAxisTickInterval(2) if you want to skip every other label.
Does it answer your question as well @mdg121212?
I am generating the series elements and list of labels in a for loop, and trying to display them like so:
`aaChartModel.apply { chartType(AAChartType.Column) when (graphInt) { 0 -> { title = "U.S. Deaths (Monthly Totals)" yAxisTitle = "Deaths" } 1 -> { title = "U.S. Hospitalizations (Monthly Totals)" yAxisTitle = "Hospitalizations" } 2 -> { title = "U.S. Total Tests (Monthly Totals)" yAxisTitle = "Tests" } 3 -> { title = "U.S. Positive Tests (Monthly Totals)" yAxisTitle = "Positive Tests" } } backgroundColor = Color.DKGRAY categories = categoryListForGraph series = listForGraph xAxisTickInterval = 2 legendEnabled = false dataLabelsEnabled = true xAxisVisible = true xAxisLabelsEnabled = true animationType = AAChartAnimationType.EaseInBack }
statChart.aa_drawChartWithChartModel(aaChartModel)`
Here categoryListForGraph is a string array, there are ten items in this array, and the graph only shows the last item. The tick interval does not seem to have any effect.