Setting the pie slice colors in MPAndroidChart

前端 未结 4 475
离开以前
离开以前 2021-01-13 08:09

I need to define specific hex values for each slice in my pie chart.

I\'m following the wiki but the method doesn\'t seem to be working for PieDataSet

4条回答
  •  误落风尘
    2021-01-13 08:50

    final int[] MY_COLORS = {
            Color.  rgb(0,255,255),
            Color. rgb(65,105,225)
    };
    
    ArrayList colors = new ArrayList<>();
    
    for(int c: MY_COLORS) colors.add(c);
    
    dataSet.setColors(colors);
    

提交回复
热议问题