MPAndroidChart fill color gradient

前端 未结 3 1794
失恋的感觉
失恋的感觉 2020-12-15 09:44

Is it possible with MPAndroidChart (or any other Android chart library) to fill the chart under the draw line with a gradient color? Something like this:

set         


        
3条回答
  •  忘掉有多难
    2020-12-15 10:14

    Okay i have found a solution:

    William Chart and i am using this method:

    int[] colors = { getResources().getColor(R.color.menu_text),
     getResources().getColor(android.R.color.white) };
    
    float[] index = { 0, 1 };
    dataset.setGradientFill(colors, index);
    

提交回复
热议问题