本文整理汇总了Java中com.github.mikephil.charting.interfaces.datasets.IDataSet.isHighlightEnabled方法的典型用法代码示例。如果您正苦于以下问题:Java IDataSet.isHighlightEnabled方法的具体用法?Java IDataSet.isHighlightEnabled怎么用?Java IDataSet.isHighlightEnabled使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.github.mikephil.charting.interfaces.datasets.IDataSet
的用法示例。
在下文中一共展示了IDataSet.isHighlightEnabled方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: isHighlightEnabled
import com.github.mikephil.charting.interfaces.datasets.IDataSet; //导入方法依赖的package包/类
/**
* Returns true if highlighting of all underlying values is enabled, false
* if not.
*
* @return
*/
public boolean isHighlightEnabled() {
for (IDataSet set : mDataSets) {
if (!set.isHighlightEnabled())
return false;
}
return true;
}
示例2: getSelectionDetailsAtIndex
import com.github.mikephil.charting.interfaces.datasets.IDataSet; //导入方法依赖的package包/类
/**
* Returns a list of SelectionDetail object corresponding to the given xIndex.
*
* @param xIndex
* @return
*/
@Override
protected List<SelectionDetail> getSelectionDetailsAtIndex(int xIndex, int dataSetIndex) {
List<SelectionDetail> vals = new ArrayList<SelectionDetail>();
float[] pts = new float[2];
CombinedData data = (CombinedData) mChart.getData();
// get all chartdata objects
List<ChartData> dataObjects = data.getAllData();
for (int i = 0; i < dataObjects.size(); i++) {
for(int j = 0; j < dataObjects.get(i).getDataSetCount(); j++) {
IDataSet dataSet = dataObjects.get(i).getDataSetByIndex(j);
// dont include datasets that cannot be highlighted
if (!dataSet.isHighlightEnabled())
continue;
// extract all y-values from all DataSets at the given x-index
final float yVals[] = dataSet.getYValsForXIndex(xIndex);
for (float yVal : yVals) {
pts[1] = yVal;
mChart.getTransformer(dataSet.getAxisDependency()).pointValuesToPixel(pts);
if (!Float.isNaN(pts[1])) {
vals.add(new SelectionDetail(pts[1], yVal, i, j, dataSet));
}
}
}
}
return vals;
}
示例3: getHighlightsAtXValue
import com.github.mikephil.charting.interfaces.datasets.IDataSet; //导入方法依赖的package包/类
/**
* Returns a list of Highlight objects representing the entries closest to the given xVal.
* The returned list contains two objects per DataSet (closest rounding up, closest rounding down).
*
* @param xVal the transformed x-value of the x-touch position
* @param x touch position
* @param y touch position
* @return
*/
protected List<Highlight> getHighlightsAtXValue(float xVal, float x, float y) {
mHighlightBuffer.clear();
BarLineScatterCandleBubbleData data = getData();
if (data == null)
return mHighlightBuffer;
for (int i = 0, dataSetCount = data.getDataSetCount(); i < dataSetCount; i++) {
IDataSet dataSet = data.getDataSetByIndex(i);
// don't include DataSets that cannot be highlighted
if (!dataSet.isHighlightEnabled())
continue;
mHighlightBuffer.addAll(buildHighlights(dataSet, i, xVal, DataSet.Rounding.CLOSEST));
}
return mHighlightBuffer;
}
示例4: getSelectionDetailsAtIndex
import com.github.mikephil.charting.interfaces.datasets.IDataSet; //导入方法依赖的package包/类
/**
* Returns a list of SelectionDetail object corresponding to the given xIndex.
*
* @param xIndex
* @param dataSetIndex dataSet index to look at. -1 if unspecified.
* @return
*/
protected List<SelectionDetail> getSelectionDetailsAtIndex(int xIndex, int dataSetIndex) {
List<SelectionDetail> vals = new ArrayList<SelectionDetail>();
if (mChart.getData() == null) return vals;
float[] pts = new float[2];
for (int i = 0, dataSetCount = mChart.getData().getDataSetCount();
i < dataSetCount;
i++) {
if (dataSetIndex > -1 && dataSetIndex != i)
continue;
IDataSet dataSet = mChart.getData().getDataSetByIndex(i);
// dont include datasets that cannot be highlighted
if (!dataSet.isHighlightEnabled())
continue;
// extract all y-values from all DataSets at the given x-index
final float[] yVals = dataSet.getYValsForXIndex(xIndex);
for (float yVal : yVals) {
if (Float.isNaN(yVal))
continue;
pts[1] = yVal;
mChart.getTransformer(dataSet.getAxisDependency()).pointValuesToPixel(pts);
if (!Float.isNaN(pts[1]))
{
vals.add(new SelectionDetail(pts[1], yVal, i, dataSet));
}
}
}
return vals;
}
示例5: getHighlightsAtXPos
import com.github.mikephil.charting.interfaces.datasets.IDataSet; //导入方法依赖的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;
}
示例6: getSelectionDetailsAtIndex
import com.github.mikephil.charting.interfaces.datasets.IDataSet; //导入方法依赖的package包/类
/**
* Returns a list of SelectionDetail object corresponding to the given xIndex.
*
* @param xIndex
* @return
*/
@Override
protected List<SelectionDetail> getSelectionDetailsAtIndex(int xIndex) {
CombinedData data = (CombinedData) mChart.getData();
// get all chartdata objects
List<ChartData> dataObjects = data.getAllData();
List<SelectionDetail> vals = new ArrayList<SelectionDetail>();
float[] pts = new float[2];
for (int i = 0; i < dataObjects.size(); i++) {
for(int j = 0; j < dataObjects.get(i).getDataSetCount(); j++) {
IDataSet dataSet = dataObjects.get(i).getDataSetByIndex(j);
// dont include datasets that cannot be highlighted
if (!dataSet.isHighlightEnabled())
continue;
// extract all y-values from all DataSets at the given x-index
final float yVal = dataSet.getYValForXIndex(xIndex);
if (yVal == Float.NaN)
continue;
pts[1] = yVal;
mChart.getTransformer(dataSet.getAxisDependency()).pointValuesToPixel(pts);
if (!Float.isNaN(pts[1])) {
vals.add(new SelectionDetail(pts[1], j, dataSet));
}
}
}
return vals;
}
示例7: getSelectionDetailsAtIndex
import com.github.mikephil.charting.interfaces.datasets.IDataSet; //导入方法依赖的package包/类
/**
* Returns a list of SelectionDetail object corresponding to the given xIndex.
*
* @param xIndex
* @return
*/
protected List<SelectionDetail> getSelectionDetailsAtIndex(int xIndex) {
List<SelectionDetail> vals = new ArrayList<SelectionDetail>();
float[] pts = new float[2];
for (int i = 0; i < mChart.getData().getDataSetCount(); i++) {
IDataSet dataSet = mChart.getData().getDataSetByIndex(i);
// dont include datasets that cannot be highlighted
if (!dataSet.isHighlightEnabled())
continue;
// extract all y-values from all DataSets at the given x-index
final float yVal = dataSet.getYValForXIndex(xIndex);
if (yVal == Float.NaN)
continue;
pts[1] = yVal;
mChart.getTransformer(dataSet.getAxisDependency()).pointValuesToPixel(pts);
if (!Float.isNaN(pts[1])) {
vals.add(new SelectionDetail(pts[1], i, dataSet));
}
}
return vals;
}
示例8: getHighlightsAtXPos
import com.github.mikephil.charting.interfaces.datasets.IDataSet; //导入方法依赖的package包/类
/**
* Returns a list of Highlight objects representing the entries closest to the given xVal.
* The returned list contains two objects per DataSet (closest rounding up, closest rounding down).
*
* @param xVal the transformed x-value of the x-touch position
* @param x touch position
* @param y touch position
* @return
*/
protected List<Highlight> getHighlightsAtXPos(float xVal, float x, float y) {
mHighlightBuffer.clear();
BarLineScatterCandleBubbleData data = getData();
if (data == null)
return mHighlightBuffer;
for (int i = 0, dataSetCount = data.getDataSetCount(); i < dataSetCount; i++) {
IDataSet dataSet = data.getDataSetByIndex(i);
// dont include datasets that cannot be highlighted
if (!dataSet.isHighlightEnabled())
continue;
Highlight high = buildHighlight(dataSet, i, xVal, DataSet.Rounding.CLOSEST);
if(high != null)
mHighlightBuffer.add(high);
//vals.add(buildHighlight(dataSet, i, xVal, DataSet.Rounding.DOWN));
}
return mHighlightBuffer;
}