本文整理汇总了Java中com.github.mikephil.charting.data.ChartData.getDataSetCount方法的典型用法代码示例。如果您正苦于以下问题:Java ChartData.getDataSetCount方法的具体用法?Java ChartData.getDataSetCount怎么用?Java ChartData.getDataSetCount使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.github.mikephil.charting.data.ChartData
的用法示例。
在下文中一共展示了ChartData.getDataSetCount方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getHighlightsAtXPos
import com.github.mikephil.charting.data.ChartData; //导入方法依赖的package包/类
@Override
protected List<Highlight> getHighlightsAtXPos(float xVal, float x, float y) {
mHighlightBuffer.clear();
List<BarLineScatterCandleBubbleData> dataObjects = mChart.getCombinedData().getAllData();
for (int i = 0; i < dataObjects.size(); i++) {
ChartData dataObject = dataObjects.get(i);
// in case of BarData, let the BarHighlighter take over
if (barHighlighter != null && dataObject instanceof BarData) {
Highlight high = barHighlighter.getHighlight(x, y);
if (high != null) {
high.setDataIndex(i);
mHighlightBuffer.add(high);
}
} else {
for (int j = 0, dataSetCount = dataObject.getDataSetCount(); j < dataSetCount; j++) {
IDataSet dataSet = dataObjects.get(i).getDataSetByIndex(j);
// don't include datasets that cannot be highlighted
if (!dataSet.isHighlightEnabled())
continue;
Highlight s1 = buildHighlight(dataSet, j, xVal, DataSet.Rounding.CLOSEST);
s1.setDataIndex(i);
mHighlightBuffer.add(s1);
// Highlight s2 = buildHighlight(dataSet, j, xVal, DataSet.Rounding.DOWN);
// s2.setDataIndex(i);
// vals.add(s2);
}
}
}
return mHighlightBuffer;
}