1

Im using MPAndroidChart Library, in Android app. I want have Spacing/Divider of 2dp/px between column entries. (Vertical spacing)

https://i.stack.imgur.com/Gqgwo.png

Pls. help me how to setup it. which is like 'setBarSpacePercent()' for horizontal spacing

progdevy
  • 11
  • 3

2 Answers2

1

So I haven't worked with the Stacked Column Bar Chart, but I'd imagine it has a method similar to the PieChart's (PieDataSet rather) 'setSliceSpace()', which allows spacing in between slices in a PieChart.

This call is in the dataSet itself, I used this tutorial for a PieChart when I was creating it; https://www.youtube.com/watch?v=VfLop_oLYU0&index=12&list=PLFzy3mLpWqF2-E-1bzaAzqh6WgkplbWs1

You can see this method at 11:25 in the video, right after he creates the DataSet.

I'm not sure what kind of DataSet a Stacked Column Bar Chart uses, but hopefully that's helpful!

I've implemented something similar in an app I'm working on (PieChart), and I've played around with this setting (anywhere from 3-10dp/px) to see what value makes sense and looks good on the PieChart.

web dever
  • 186
  • 5
  • Thanks Zach, I already know the setSliceSpace for pieChart and used it in past. Its similar to setBarSpacePercent. In which both sets spacing b/w Bars/Slices aka.Y-axis entries. Here I want like set spacing with in the bar itself. – progdevy Apr 19 '16 at 22:58
  • Ahh, okay. What's the name of the DataSet that the Stacked Column Bar Chart uses? – web dever Apr 20 '16 at 14:21
  • In looking at Philip's example here; https://github.com/PhilJay/MPAndroidChart/blob/master/MPChartExample/src/com/xxmassdeveloper/mpchartexample/StackedBarActivity.java he doesn't have any values set to add space between the bars like you're looking for... – web dever Apr 20 '16 at 15:44
  • Looks like there's a BarDataSet "setBarSpacePercent(float percent)" method? That's the only thing I could find that resembles what you're after. – web dever Apr 20 '16 at 16:16
-1
BarData.setBarWidth(0.8f); // set custom bar width
Eiko
  • 25,601
  • 15
  • 56
  • 71
Kevin
  • 1
  • 2
  • Bar width will set spacing between 2 parallel bars. He as well as I am looking for spacing between single column group spacing – Sagar Patil Jun 13 '18 at 11:25