title: MPAndroidChart : Is it possible to rotate value labels for a given DataSet?
body: <p>In my Android application I have a bar chart I made using <code>MPAndroidChart</code>. My problem is when there are a number of bars in bar chart then the value labels above each bar are overlapping with other value labels as shown in the attached screen shot below. I know this is because there is no room for displaying the label, but I think this can be avoided if it is possible to rotate the value label by 90 degrees like in XAxis labels in my screen shot. So is that possible? If I zoomed then I can see all values clearly. I am using <code>MPAndroidChart</code> v3.0.1.</p>
  
  <p><a href="https://i.stack.imgur.com/mSHZL.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/mSHZL.jpg" alt="MPAndroid Chart"></a></p>
  
  <p>Below is my code.</p>
  
  <pre><code>        yVals1 = new ArrayList&lt;BarEntry&gt;();
      xVals = new ArrayList&lt;String&gt;();
      for (int i = 0; i &lt; listChart.size(); i++){
          BarEntry newBEntry = new BarEntry(i,listChart.get(i).getAmount());
          xVals.add(listChart.get(i).getAltName());
          yVals1.add(newBEntry);
      }
      BarDataSet set1;
      if (bChartRepOne.getData() != null &amp;&amp; bChartRepOne.getData().getDataSetCount() &gt; 0) {
          set1 = (BarDataSet) bChartRepOne.getData().getDataSetByIndex(0);
          set1.setValues(yVals1);
          bChartRepOne.getData().notifyDataChanged();
          bChartRepOne.notifyDataSetChanged();
      } else {
          set1 = new BarDataSet(yVals1, chart);
          set1.setColors(ColorTemplate.MATERIAL_COLORS);
          ArrayList&lt;IBarDataSet&gt; dataSets = new ArrayList&lt;IBarDataSet&gt;();
          dataSets.add(set1);
          BarData data = new BarData(dataSets);
          data.setValueTextSize(8f);
  
          bChartRepOne.setData(data);
      }
  
      XAxis xAxis = bChartRepOne.getXAxis();
      xAxis.setPosition(XAxis.XAxisPosition.BOTTOM);
      xAxis.setDrawGridLines(false);
      xAxis.setLabelCount(xList.size()-1);
      xAxis.setGranularity(1f); // only intervals of 1 day
      xAxis.setValueFormatter(new IAxisValueFormatter() {
          @Override
          public String getFormattedValue(float value, AxisBase axis) {
              if(Math.round(value) &gt;= xList.size()) {
                  return null;
              } else {
                  return xList.get(Math.round(value));
              }
          }
      });
      xAxis.setLabelRotationAngle(-90);
  
      YAxis leftAxis = bChartRepOne.getAxisLeft();
      leftAxis.setLabelCount(8, false);
      leftAxis.setPosition(YAxis.YAxisLabelPosition.OUTSIDE_CHART);
      leftAxis.setSpaceTop(15f);
      YAxis rightAxis = bChartRepOne.getAxisRight();
      rightAxis.setEnabled(false);
  
      Legend l = bChartRepOne.getLegend();
      l.setEnabled(false);
  
      bChartRepOne.setOnChartValueSelectedListener(new OnChartValueSelectedListener() {
          @Override
          public void onValueSelected(Entry entry, Highlight highlight) {
  
          }
  
          @Override
          public void onNothingSelected() {
  
          }
      });
  </code></pre>