Changing the color of the x-axis label text
I have tried the following in Kotlin, with multiple different colors.
- chart.xAxis.textColor = R.color.white
The text changes color very slightly, but never to the correct color. It becomes a purplish blue, has anyone else had this problem? I recreated a small test app just with the graph to test it again, it's just a fragment with the single graph view.
private fun setupGraph() { var entry = Entry(1F, 1F) entries.add(entry) graph_bac.xAxis.textColor = R.color.white graph_bac.data = LineData(LineDataSet(entries, "test")) var xAxis = graph_bac.xAxis xAxis.axisMinimum = 0F xAxis.axisMaximum = 10F xAxis.granularity = 1F xAxis.position = XAxis.XAxisPosition.BOTTOM graph_bac.notifyDataSetChanged() graph_bac.invalidate() }
Use Context.getResource.getColor(...)
Thank-you that worked
Thank You mate