title: MPAndroidChart StackedBarChart showing values but no bars
body: <p>I am starting to use the <a href="https://github.com/PhilJay/MPAndroidChart" rel="nofollow noreferrer"><code>MPAndroidChart</code></a> library to build a <code>StackedBarChart</code> showing three y values. Here is the code:</p>
  
  <pre><code>public class Plot
  {
      final Context context;
      final BarData data;
  
      private int count;
  
      public StackedBarPlot(Context context)
      {
          this.context = context;
          data = setData();
      }
  
      protected BarData setData()
      {
          final List&lt;BarEntry&gt; entries = new ArrayList&lt;&gt;();
          for (DatabaseEntry entry : entryList)
          {
              final float total = (float) entry.getTotal();
              final float[] y = {100 * entry.getN1() / total,
                      100 * entry.getN2() / total, 100 * entry.getN3() / total};
              entries.add(new BarEntry(/*long*/entry.getDate(), y));
          }
          count = entries.size();
  
  
          final BarDataSet dataset = new BarDataSet(entries, null);
          dataset.setColors(new int[]{R.color.green, R.color.blue, R.color.red}, context);
          dataset.setStackLabels(labels);
          dataset.setDrawValues(true);
          dataset.setVisible(true);
  
          final BarData data = new BarData(dataset);
          data.setBarWidth(0.9f);
          return data;
      }
  
      public BarChart getChart(int id, View view)
      {
          final BarChart chart = (BarChart) view.findViewById(id);   
  
          chart.getAxisRight().setEnabled(false);
          chart.getAxisLeft().setEnabled(false);
          final Legend legend = chart.getLegend();
          legend.setDrawInside(true);
          legend.setVerticalAlignment(Legend.LegendVerticalAlignment.TOP);
          legend.setHorizontalAlignment(Legend.LegendHorizontalAlignment.CENTER);
  
          final XAxis xAxis = chart.getXAxis();
          xAxis.setValueFormatter(dateFormatter);
          xAxis.setPosition(XAxis.XAxisPosition.BOTTOM);
          xAxis.setDrawGridLines(false);
          xAxis.setLabelCount(count);
  
          chart.getDescription().setEnabled(false);
          chart.setData(data);
          chart.setFitBars(true);
          chart.invalidate();
          return chart;
      }
  
      private final IAxisValueFormatter dateFormatter = new IAxisValueFormatter()
      {
          @Override
          public String getFormattedValue(float value, AxisBase axis)
          {
              return new DateTime((long) value).toString(context.getString("E, MMM d"));
          }
      };
  }
  </code></pre>
  
  <p>Then in my <code>Fragment</code>, I call:</p>
  
  <pre><code>public class MyFragment extends Fragment
  {
      private Plot plot;
  
      @Override
      public void onCreate(Bundle savedInstanceState)
      {
          super.onCreate(savedInstanceState);
          plot = new Plot(getActivity());
      }
  
      @Nullable
      @Override
      public View onCreateView(LayoutInflater inflater, ViewGroup parent, Bundle savedInstanceState)
      {
          final View view = inflater.inflate(R.layout.fragment, parent, false);
          plot.getChart(R.id.chart, view);
          return view;
      }
  }
  </code></pre>
  
  <p>And in MainActivity.java</p>
  
  <pre><code>getFragmentManager().beginTransaction().replace(R.id.content, fragment).commit();
  </code></pre>
  
  <p><strong>main_activity.xml</strong></p>
  
  <pre><code> &lt;android.support.v4.widget.DrawerLayout
      android:id="@+id/drawer_layout"
      xmlns:android="http://schemas.android.com/apk/res/android"
      xmlns:app="http://schemas.android.com/apk/res-auto"
      xmlns:tools="http://schemas.android.com/tools"
      android:layout_width="match_parent"
      android:layout_height="match_parent"
      tools:context=".MainActivity"&gt;
  
      &lt;android.support.design.widget.CoordinatorLayout
          android:layout_width="match_parent"
          android:layout_height="match_parent"&gt;
  
          &lt;android.support.design.widget.AppBarLayout
              android:layout_width="match_parent"
              android:layout_height="wrap_content"
              android:theme="@style/AppTheme.AppBarOverlay"&gt;
  
              &lt;android.support.v7.widget.Toolbar
                  android:id="@+id/toolbar"
                  android:layout_width="match_parent"
                  android:layout_height="?attr/actionBarSize"
                  android:background="?attr/colorPrimary"
                  app:popupTheme="@style/AppTheme.PopupOverlay"/&gt;
  
          &lt;/android.support.design.widget.AppBarLayout&gt;
  
          &lt;FrameLayout
              android:id="@+id/content"
              android:layout_width="match_parent"
              android:layout_height="match_parent"
              app:layout_behavior="@string/appbar_scrolling_view_behavior"/&gt;
      &lt;/android.support.design.widget.CoordinatorLayout&gt;
  
      &lt;android.support.design.widget.NavigationView
          android:id="@+id/navigation"
          android:layout_width="wrap_content"
          android:layout_height="match_parent"
          android:layout_gravity="start"
          android:fitsSystemWindows="true"
          app:headerLayout="@layout/drawer_header"
          app:menu="@menu/navigation"/&gt;
  
  &lt;/android.support.v4.widget.DrawerLayout&gt;
  </code></pre>
  
  <p><strong>fragment.xml</strong></p>
  
  <pre><code>&lt;RelativeLayout
      xmlns:android="http://schemas.android.com/apk/res/android"
      android:layout_width="match_parent"
      android:layout_height="match_parent"
      android:padding="16dp"&gt;
  
      &lt;com.github.mikephil.charting.charts.BarChart
          android:id="@+id/chart"
          android:layout_width="match_parent"
          android:layout_height="match_parent"/&gt;
  &lt;/RelativeLayout&gt;
  </code></pre>
  
  <p>The problem is the bars are not rendering correctly. I can see values but the bars are not displaying in the chart. Any advice?</p>