use of com.github.mikephil.charting.interfaces.datasets.IBarDataSet in project MPAndroidChart by PhilJay.
the class BarHighlighter method getHighlight.
@Override
public Highlight getHighlight(float x, float y) {
Highlight high = super.getHighlight(x, y);
if (high == null) {
return null;
}
MPPointD pos = getValsForTouch(x, y);
BarData barData = mChart.getBarData();
IBarDataSet set = barData.getDataSetByIndex(high.getDataSetIndex());
if (set.isStacked()) {
return getStackedHighlight(high, set, (float) pos.x, (float) pos.y);
}
MPPointD.recycleInstance(pos);
return high;
}
use of com.github.mikephil.charting.interfaces.datasets.IBarDataSet in project LeMondeRssReader by MBach.
the class GraphExtractor method generate.
Object generate() {
BarChart barChart = new BarChart(context);
List<BarEntry> yVals1 = new ArrayList<>();
for (int i = 0; i < 30; i++) {
float mult = 5;
float val = (float) (Math.random() * mult);
yVals1.add(new BarEntry(i, val));
}
BarDataSet set1 = new BarDataSet(yVals1, "The year 2017");
List<IBarDataSet> dataSets = new ArrayList<>();
dataSets.add(set1);
BarData barData = new BarData(dataSets);
barChart.setData(barData);
return barChart;
}
Aggregations