title: MPAndroidChart: How to create grouped BarChart?
body: <p>I am using <a href="https://github.com/PhilJay/MPAndroidChart" rel="nofollow noreferrer">MPAndroidChart</a> to create grouped Dataset, but it is showing an error <code>BarData data = new BarData(labels,dataSets );</code> at this line that is <code>Unable to resolve constructor,BarData(java.util.ArrayList)&lt;java.lang.String&gt;,java.util.ArrayList&lt;com.github.mikephil.charting.data.BarDataSet;&gt;</code> I have also casted <code>IBarDataSet</code> then the Application is getting <code>Unfortunately Stopped</code>. I have used dependency <code>compile 'com.github.PhilJay:MPAndroidChart:v2.2.4'</code>. Somebody Please help me!!</p>
  
  <pre><code>//create BarEntry for group 1
              ArrayList&lt;BarEntry&gt; group1 = new ArrayList&lt;&gt;();
              group1.add(new BarEntry(4f, 0));
              group1.add(new BarEntry(8f, 1));
              group1.add(new BarEntry(6f, 2));
              group1.add(new BarEntry(12f, 3));
              group1.add(new BarEntry(18f, 4));
              group1.add(new BarEntry(9f, 5));
  
              // create BarEntry for group 2
              ArrayList&lt;BarEntry&gt; group2 = new ArrayList&lt;&gt;();
              group2.add(new BarEntry(6f, 0));
              group2.add(new BarEntry(7f, 1));
              group2.add(new BarEntry(8f, 2));
              group2.add(new BarEntry(12f, 3));
              group2.add(new BarEntry(15f, 4));
              group2.add(new BarEntry(10f, 5));
  
              // creating dataset for group1
              BarDataSet barDataSet1 = new BarDataSet(group1, "Brand 1");
              barDataSet1.setColors(ColorTemplate.COLORFUL_COLORS);
  
              // creating dataset for group2
              BarDataSet barDataSet2 = new BarDataSet(group2, "Brand 2");
              barDataSet2.setColors(ColorTemplate.COLORFUL_COLORS);
  
              // combined all dataset into an arraylist
              ArrayList&lt;BarDataSet&gt; dataSets = new ArrayList&lt;&gt;();
              dataSets.add(barDataSet1);
              dataSets.add(barDataSet2);
  
  
              ArrayList&lt;String&gt; labels = new ArrayList&lt;&gt;();
              labels.add("JAN");
              labels.add("FEB");
              labels.add("MAR");
              labels.add("APR");
              labels.add("MAY");
              labels.add("JUN");
              BarData data = new BarData(labels,dataSets );// initialize the Bardata with argument labels and dataSet
              barChartGroup.setData(data);
  </code></pre>
  
  <p>I want to get the dataset like the following example : - </p>
  
  <p><a href="https://i.stack.imgur.com/sX86q.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/sX86q.png" alt="Grouped DataSet"></a></p>
  
  <p>Thanks!!</p>