MPAndroidChart how to set label color?

后端 未结 2 1032
无人及你
无人及你 2020-12-17 17:35

got the following code:

    graph = (LineChart) convertView.findViewById(R.id.graph);
    graph.getPaint(Chart.PAINT_LEGEND_LABEL).setColor(Color.BLUE);
             


        
相关标签:
2条回答
  • 2020-12-17 17:57

    Try this to set the colors of axis and legend:

    chart.getAxisLeft().setTextColor(...); // left y-axis
    chart.getXAxis().setTextColor(...);
    chart.getLegend().setTextColor(...);
    

    If you want to set the color of the drawn values inside the chart, check out the setting colors documentation or the setting data documentation.

    0 讨论(0)
  • 2020-12-17 18:01

    Incase for a pie chat to change its label colors you can do this

    pieChart.getLegend().setTextColor(Color.WHITE);
    
    0 讨论(0)
提交回复
热议问题