Buggy code:
public class StackedBarActivityNegative extends DemoBase implements OnChartValueSelectedListener { private HorizontalBarChart mChart ; @ Override protected void onCreate ( Bundle savedInstanceState ) { super . onCreate ( savedInstanceState ) ; getWindow ( ) . setFlags ( FLAG_FULLSCREEN , FLAG_FULLSCREEN ) ; setContentView ( activity_age_distribution ) ; setTitle ( "Age<seq2seq4repair_space>Distribution<seq2seq4repair_space>Austria" ) ; mChart = ( ( HorizontalBarChart ) ( findViewById ( chart1 ) ) ) ; mChart . setOnChartValueSelectedListener ( this ) ; mChart . setDrawGridBackground ( false ) ; mChart . setDescription ( "" ) ; mChart . setPinchZoom ( false ) ; mChart . setDrawBarShadow ( false ) ; mChart . setDrawValueAboveBar ( true ) ; mChart . getAxisLeft ( ) . setEnabled ( false ) ; mChart . getAxisRight ( ) . setStartAtZero ( false ) ; mChart . getAxisRight ( ) . setAxisMaxValue ( 25.0F ) ; mChart . getAxisRight ( ) . setAxisMinValue ( ( - 25.0F ) ) ; mChart . getAxisRight ( ) . setLabelCount ( 7 ) ; mChart . getAxisRight ( ) . setValueFormatter ( new StackedBarActivityNegative . CustomFormatter ( ) ) ; mChart . getAxisRight ( ) . setTextSize ( 9.0F ) ; XAxis xAxis = mChart . getXAxis ( ) ; xAxis . setPosition ( BOTH_SIDED ) ; xAxis . setDrawGridLines ( false ) ; xAxis . setDrawAxisLine ( false ) ; xAxis . setTextSize ( 9.0F ) ; Legend l = mChart . getLegend ( ) ; l . setPosition ( BELOW_CHART_RIGHT ) ; l . setFormSize ( 8.0F ) ; l . setFormToTextSpace ( 4.0F ) ; l . setXEntrySpace ( 6.0F ) ; ArrayList < BarEntry > yValues = new ArrayList < BarEntry > ( ) ; yValues . add ( new BarEntry ( new float [ ] { - 10 , 10 } , 0 ) ) ; yValues . add ( new BarEntry ( new float [ ] { - 12 , 13 } , 1 ) ) ; yValues . add ( new BarEntry ( new float [ ] { - 15 , 15 } , 2 ) ) ; yValues . add ( new BarEntry ( new float [ ] { - 17 , 17 } , 3 ) ) ; yValues . add ( new BarEntry ( new float [ ] { - 19 , 20 } , 4 ) ) ; yValues . add ( new BarEntry ( new float [ ] { - 19 , 19 } , 5 ) ) ; yValues . add ( new BarEntry ( new float [ ] { - 16 , 16 } , 6 ) ) ; yValues . add ( new BarEntry ( new float [ ] { - 13 , 14 } , 7 ) ) ; yValues . add ( new BarEntry ( new float [ ] { - 10 , 11 } , 8 ) ) ; yValues . add ( new BarEntry ( new float [ ] { - 5 , 6 } , 9 ) ) ; yValues . add ( new BarEntry ( new float [ ] { - 1 , 2 } , 10 ) ) ; BarDataSet set = new BarDataSet ( yValues , "Age<seq2seq4repair_space>Distribution" ) ; set . setValueFormatter ( new StackedBarActivityNegative . CustomFormatter ( ) ) ; set . setValueTextSize ( 7.0F ) ; set . setAxisDependency ( RIGHT ) ; <START_BUG> set . setBarSpacePercent ( 50.0F ) ; <END_BUG> set . setColors ( new int [ ] { Color . rgb ( 67 , 67 , 72 ) , Color . rgb ( 124 , 181 , 236 ) } ) ; set . setStackLabels ( new String [ ] { "Men" , "Women" } ) ; String [ ] xVals = new String [ ] { "0-10" , "10-20" , "20-30" , "30-40" , "40-50" , "50-60" , "60-70" , "70-80" , "80-90" , "90-100" , "100+" } ; BarData data = new BarData ( xVals , set ) ; mChart . setData ( data ) ; mChart . invalidate ( ) ; } @ Override public boolean onCreateOptionsMenu ( Menu menu ) { } @ Override public boolean onOptionsItemSelected ( MenuItem item ) { } @ Override public void onValueSelected ( Entry e , int dataSetIndex , Highlight h ) { } @ Override public void onNothingSelected ( ) { } private class CustomFormatter implements ValueFormatter { private DecimalFormat mFormat ; public CustomFormatter ( ) { } @ Override public String getFormattedValue ( float value ) { } } }

Fix:
set . setBarSpacePercent ( 40.0F ) ;