title: How to show labels on right and values to left side in HorizontalBarChart?
body: <p>Drawing a horizontal bar chart using <a href="https://github.com/PhilJay/MPAndroidChart" rel="nofollow noreferrer">MPAndroidChart</a> 3.0.2. the values are shown on the right of the bars. I could use setValueFormatter and use IAxisValueFormatter interface to display the labels on the right. But the values are not displayed now. </p>
  
  <pre><code>{
      HorizontalBarChart barChart = (HorizontalBarChart) itemView.findViewById(R.id.barChart);
  
              BarData data = new BarData();
  
          ArrayList&lt;BarEntry&gt; valueSet1 = new ArrayList&lt;&gt;();
  
          ArrayList&lt;String&gt; labels = new ArrayList&lt;&gt;();
          labels.add("January");
          labels.add("February");
          labels.add("March");
          labels.add("April");
          labels.add("May");
          labels.add("June");
          ArrayList&lt;String&gt; ylabels = new ArrayList&lt;&gt;();
          int dataCount=0;
          for (int i=0;i&lt;6;++i) {
              BarEntry entry = new BarEntry(dataCount,(i+1)*2);
              valueSet1.add(entry);
              ylabels.add(" "+i);
              dataCount++;
          }
          List&lt;IBarDataSet&gt; dataSets = new ArrayList&lt;&gt;();
          BarDataSet bds = new BarDataSet(valueSet1, " ");
          bds.setColors(ColorTemplate.MATERIAL_COLORS);
          String[] xAxisLabels = labels.toArray(new String[0]);
          String[] yAxisLabels = ylabels.toArray(new String[0]);
          bds.setStackLabels(xAxisLabels);
          dataSets.add(bds);
          data.addDataSet(bds);
          data.setDrawValues(true);
          data.setBarWidth(0.4f);
  
          XAxis xaxis = barChart.getXAxis();
          xaxis.setDrawGridLines(false);
          xaxis.setPosition(XAxis.XAxisPosition.BOTTOM);
          xaxis.setGranularityEnabled(true);
          xaxis.setGranularity(1);
          xaxis.setDrawLabels(true);
          xaxis.setLabelCount(dataCount+1);
              xaxis.setXOffset(10);
              xaxis.setDrawAxisLine(false);
              CategoryBarChartXaxisFormatter xaxisFormatter = new CategoryBarChartXaxisFormatter(xAxisLabels);
              xaxis.setValueFormatter(xaxisFormatter);
  
              YAxis yAxisLeft = barChart.getAxisLeft();
              yAxisLeft.setEnabled(false);
  
              YAxis yAxisRight = barChart.getAxisRight();
             yAxisRight.setPosition(YAxis.YAxisLabelPosition.INSIDE_CHART);
              yAxisRight.setDrawGridLines(false);
              yAxisRight.setDrawAxisLine(false);
  
              Legend legend = barChart.getLegend();
              legend.setEnabled(false);
  
              barChart.setFitBars(true);
              barChart.setData(data);
              barChart.setDescription(null);
  }
  public class CategoryBarChartXaxisFormatter implements IAxisValueFormatter {
  
     private String[] mValues;
  
     public CategoryBarChartXaxisFormatter(String[] values) {
         this.mValues = values;
     }
  
     @Override
     public String getFormattedValue(float value, AxisBase axis) {
  
         int val = (int)value;
         String label="";
         if(val&gt;=0 &amp;&amp; val&lt;mValues.length) {
             label= mValues[val];
         }
         else {
             label= "";
         }
         return label;
     }
  }
  </code></pre>
  
  <p>requirement is to display label strings on the right and a number on the left corresponding to each bar. 
  I did check some stack overflow and google it but didn't find anything that works so far.</p>
  
  <p>i get this 
  <a href="https://i.stack.imgur.com/FcJ4T.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/FcJ4T.png" alt="enter image description here"></a></p>
  
  <p>but this is an example of my requirement<a href="https://i.stack.imgur.com/ig58z.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ig58z.png" alt="enter image description here"></a>
  Do appreciate some help.
  Thanks for your time</p>