Question: I am currently working on implementing the MpAndroid Chart Library from Philip Jay GitHub account.
Following some tutorials, I have done its implementation. But I am having a very simple issue in adjusting the weight of the bar. 

I am implementing it in such a way that its layout height would be 1/3 of my Screen and so the width. I tried different method using my layout but couldn't resolve the issue.

Is there any workaround I can do to change or adjust the weight of each bars preferably, a quarter of whats implemented is all I need. Also how can I change the background of the chart.

Would be glad if I can get a guideline on how to do it. Appreciate your response in advance

Answer: 
For bar weight, one way is use:

```
BarDataSet set = new BarDataSet(vals, "Set A");
set.setBarSpacePercent(50f);

```

Another alternate way is use `BarChart.setVisibleXRangeMaximum(10)` and `BarChart.setVisibleXRangeMinimum(10);`. This will show only 10 bars at a time and thus we can set indirectly weight of bar. To view more, you need to scroll right or left.

For more details about weight, you can refer [this](https://github.com/PhilJay/MPAndroidChart/issues/197).

To change background of chart, you can use `BarChart.setBackgroundColor(...)` or `BarChart.setBackgroundResource(...)`
```
    chart=(BarChart)findViewById(R.id.chart);
    ArrayList<String> xAxis=new ArrayList<>();
    ArrayList<IBarDataSet> dataSets=null;
    ArrayList<BarEntry> valueSet=new ArrayList<>();

    xAxis.add("Mozilla Firefox");
    xAxis.add("Google Chrome");
    xAxis.add("Internet Explorer");
    xAxis.add("Safari");

    valueSet.add(new BarEntry(25,0));
    valueSet.add(new BarEntry(20,1));
    valueSet.add(new BarEntry(40,2));
    valueSet.add(new BarEntry(30,3));

    BarDataSet barDataSet=new BarDataSet(valueSet,"Browser");
    barDataSet.setColors(new int[] {Color.RED,Color.GREEN,Color.MAGENTA,Color.BLUE});

    dataSets=new ArrayList<>();
    dataSets.add(barDataSet);

    YAxis yAxisRight=chart.getAxisRight();
    yAxisRight.setEnabled(false);

    BarData data=new BarData(xAxis,dataSets);
    chart.setExtraOffsets(0,0,0,20);
    chart.setData(data);
    chart.animateXY(2000,2000);
    chart.invalidate();

```