-
- All Implemented Interfaces:
-
java.io.Serializable
public class BarData extends BarLineScatterCandleBubbleData<IBarDataSet>
Data object that represents all data for the BarChart.
-
-
Constructor Summary
Constructors Constructor Description BarData()BarData(Array<IBarDataSet> dataSets)BarData(List<IBarDataSet> dataSets)
-
Method Summary
Modifier and Type Method Description voidsetBarWidth(float mBarWidth)Sets the width each bar should have on the x-axis (in values, not pixels).Default 0. floatgetBarWidth()voidgroupBars(float fromX, float groupSpace, float barSpace)Groups all BarDataSet objects this data object holds together by modifying the x-value of their entries.Previously set x-values of entries will be overwritten. floatgetGroupWidth(float groupSpace, float barSpace)In case of grouped bars, this method returns the space an individual group of bar needs on the x-axis. -
Methods inherited from class com.github.mikephil.charting.data.ChartData
addDataSet, addEntry, calcMinMaxY, clearValues, contains, getColors, getDataSetByIndex, getDataSetByLabel, getDataSetCount, getDataSetForEntry, getDataSetLabels, getDataSets, getEntryCount, getEntryForHighlight, getFirstRight, getIndexOfDataSet, getMaxEntryCountSet, getXMax, getXMin, getYMax, getYMax, getYMin, getYMin, isHighlightEnabled, notifyDataChanged, removeDataSet, removeDataSet, removeEntry, removeEntry, setDrawValues, setHighlightEnabled, setValueFormatter, setValueTextColor, setValueTextColors, setValueTextSize, setValueTypeface -
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
Constructor Detail
-
BarData
BarData()
-
BarData
BarData(Array<IBarDataSet> dataSets)
-
BarData
BarData(List<IBarDataSet> dataSets)
-
-
Method Detail
-
setBarWidth
void setBarWidth(float mBarWidth)
Sets the width each bar should have on the x-axis (in values, not pixels).Default 0.85f
-
getBarWidth
float getBarWidth()
-
groupBars
void groupBars(float fromX, float groupSpace, float barSpace)
Groups all BarDataSet objects this data object holds together by modifying the x-value of their entries.Previously set x-values of entries will be overwritten. Leaves space between bars and groups as specifiedby the parameters.Do not forget to call notifyDataSetChanged() on your BarChart object after calling this method.
- Parameters:
fromX- the starting point on the x-axis where the grouping should begingroupSpace- the space between groups of bars in values (not pixels) e.g.barSpace- the space between individual bars in values (not pixels) e.g.
-
getGroupWidth
float getGroupWidth(float groupSpace, float barSpace)
In case of grouped bars, this method returns the space an individual group of bar needs on the x-axis.
-
-
-
-