MPAndroidChart白色背景

nam*_*mit 1 android background mpandroidchart

我正在使用MPAndroidChart库.我正在使用MPAndroidChart设置包含数据的多线图.它工作得很好,但背景是白色的.这就是我在做的事情

        nhChart = new LineChart(getActivity());
        nhChart.setDescription("Number of Hits View");
        nhChart = (LineChart) hitsView.findViewById(R.id.line_chart_number_of_hits);

        //int color = Color.parseColor("#80101010");
        nhChart.setBackgroundColor(Color.parseColor("#80101010"));
        //nhChart.setBackgroundResource(R.drawable.background_portrate);
        //nhChart.setBackground(getResources().getDrawable(R.drawable.background_portrate));

        nhChart.setStartAtZero(true);   
        nhChart.setDrawBorder(true);

        nhChart.setNoDataTextDescription("No Data available for Charts");

        nhChart.setDrawYValues(false);
        nhChart.setDrawBorder(true);
        nhChart.setScaleEnabled(true);

        nhChart.setHighlightEnabled(false);
        nhChart.setTouchEnabled(true);
        //nhChart.setGridColor(Color.WHITE & 0x70FFFFFF);
        //nhChart.setDragScaleEnabled(true);    
        nhChart.setPinchZoom(true);

        setData(valueDate.size(),10000);
        nhChart.animateX(2500);

        Legend l = nhChart.getLegend();
        l.setForm(LegendForm.CIRCLE);
        l.setFormSize(6f);
        l.setTextColor(Color.WHITE);

        YLabels y = nhChart.getYLabels();
        y.setTextColor(Color.WHITE);
        y.setLabelCount(6);

        XLabels x1 = nhChart.getXLabels();
        x1.setCenterXLabelText(true);
        x1.setPosition(XLabelPosition.BOTTOM);
        x1.setTextColor(Color.WHITE);
Run Code Online (Sandbox Code Playgroud)

我正在片段viewpager中的AsyncTask的post execute方法中绘制线图.显示图表的其他片段显示相同的白色背景.我尝试为背景设置颜色但没有任何效果.我也把它留空了,但它仍然显示我的白色背景.我还更新了最新的Jar,但它不起作用.请帮忙.这是图像的外观

rtc*_*c11 5

你希望这个透明:

chart.setDrawGridBackground(false);
Run Code Online (Sandbox Code Playgroud)

这对于透明条:

chart.setDrawBarShadow(false);
Run Code Online (Sandbox Code Playgroud)