I use MPChartlib for the base "Barchart" (3 bars and values ββfrom 0 to 100).
the background of the application is dark, so I want to put the text in white, but when I set the text with the color code "FFFFFF" to chart_color stored in the string.xml file, but the text is displayed in blue.
`//Axe X XAxis x = barchart.getXAxis(); x.setPosition(XAxisPosition.BOTTOM); x.setTextColor(R.color.chart_color); x.setAxisLineColor(R.color.chart_color); // Design barchart.setDragEnabled(false); barchart.setDrawGridBackground(false); barchart.setTouchEnabled(false); barchart.setHighlightEnabled(false); barchart.setMaxVisibleValueCount(101); barchart.setDescription(null); barchart.setGridBackgroundColor(R.color.chart_color); barchart.invalidate(); // refresh //Axe Y barchart.getAxisLeft().setAxisMaxValue(100); barchart.getAxisLeft().setDrawTopYLabelEntry(true); barchart.getAxisLeft().setDrawAxisLine(false); barchart.getAxisLeft().setDrawGridLines(false); barchart.getAxisLeft().setAxisLineColor(R.color.chart_color); barchart.getAxisLeft().setTextColor(R.color.chart_color); barchart.getAxisRight().setAxisMaxValue(100); barchart.getAxisRight().setDrawTopYLabelEntry(true); barchart.getAxisRight().setAxisLineColor(R.color.chart_color); barchart.getAxisRight().setTextColor(R.color.chart_color); `
I tried a lot of things and research, but could not find the problem, is not lib using the same color code or something else?
Thanks for your help, Alex
android colors charts textcolor mpandroidchart
Alexandre
source share