public class BarHighlighter extends ChartHighlighter<BarDataProvider>
mChart| Constructor and Description |
|---|
BarHighlighter(BarDataProvider chart) |
| Modifier and Type | Method and Description |
|---|---|
protected float |
getBase(float x)
Returns the base x-value to the corresponding x-touch value in pixels.
|
protected int |
getClosestStackIndex(Range[] ranges,
float value)
Returns the index of the closest value inside the values array / ranges (stacked barchart) to the value given as
a parameter.
|
protected int |
getDataSetIndex(int xIndex,
float x,
float y)
Returns the corresponding dataset-index for a given xIndex and xy-touch position in pixels.
|
Highlight |
getHighlight(float x,
float y)
Returns a Highlight object corresponding to the given x- and y- touch positions in pixels.
|
protected Range[] |
getRanges(BarEntry entry)
Splits up the stack-values of the given bar-entry into Range objects.
|
protected Highlight |
getStackedHighlight(Highlight old,
BarDataSet set,
int xIndex,
int dataSetIndex,
double yValue)
This method creates the Highlight object that also indicates which value of a stacked BarEntry has been selected.
|
protected int |
getXIndex(float x)
Returns the corresponding x-index for a given touch-position in pixels.
|
getSelectionDetailsAtIndexpublic BarHighlighter(BarDataProvider chart)
public Highlight getHighlight(float x, float y)
ChartHighlightergetHighlight in class ChartHighlighter<BarDataProvider>protected int getXIndex(float x)
ChartHighlightergetXIndex in class ChartHighlighter<BarDataProvider>protected int getDataSetIndex(int xIndex,
float x,
float y)
ChartHighlightergetDataSetIndex in class ChartHighlighter<BarDataProvider>protected Highlight getStackedHighlight(Highlight old, BarDataSet set, int xIndex, int dataSetIndex, double yValue)
old - the old highlight object before looking for stacked valuesset - xIndex - dataSetIndex - yValue - protected int getClosestStackIndex(Range[] ranges, float value)
ranges - value - protected float getBase(float x)
x -