Mpandroid图表线图显示在背景颜色后的线

时间:2017-11-03 10:47:18

标签: java android charts

你好我在我的应用程序中使用下面的代码,但mpandroidchart线图显示背景后面这是我的代码

float rangeLow = 66f;
float rangeHigh = 120f;

    YAxis fillAxis = lineChart.getAxisLeft();

    float increment = (rangeHigh - rangeLow) / 20;
    float metricLine = rangeLow;

    for(int i = 0; i < 20; i++) {

        LimitLine llRange = new LimitLine(metricLine, "");
        llRange.setLineColor(Color.parseColor("#f2befb"));
        llRange.setLineWidth(100f);
        fillAxis.addLimitLine(llRange);
        metricLine = metricLine + increment;
    }

1 个答案:

答案 0 :(得分:0)

而不是:

 llRange.setLineColor(Color.parseColor("#f2befb"));

使用此:

 llRange.setLineColor(Color.parseColor("#80f2befb"));

我在你的颜色开始时添加了80,这使得它透明度为50%。对于transperancy,您可以在颜色十六进制代码之前添加数字,如下所示:

0% = #00
10% = #16
20% = #32
30% = #48
40% = #64
50% = #80
60% = #96
70% = #112
80% = #128
90% = #144