本文整理匯總了Java中com.github.mikephil.charting.highlight.Highlight.equalTo方法的典型用法代碼示例。如果您正苦於以下問題:Java Highlight.equalTo方法的具體用法?Java Highlight.equalTo怎麽用?Java Highlight.equalTo使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類com.github.mikephil.charting.highlight.Highlight
的用法示例。
在下文中一共展示了Highlight.equalTo方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: performHighlightDrag
import com.github.mikephil.charting.highlight.Highlight; //導入方法依賴的package包/類
/**
* Highlights upon dragging, generates callbacks for the selection-listener.
*
* @param e
*/
private void performHighlightDrag(MotionEvent e) {
Highlight h = mChart.getHighlightByTouchPoint(e.getX(), e.getY());
if (h != null && !h.equalTo(mLastHighlighted)) {
mLastHighlighted = h;
mChart.highlightValue(h, true);
}
}
示例2: performHighlight
import com.github.mikephil.charting.highlight.Highlight; //導入方法依賴的package包/類
/**
* Perform a highlight operation.
*
* @param e
*/
protected void performHighlight(Highlight h, MotionEvent e) {
if (h == null || h.equalTo(mLastHighlighted)) {
mChart.highlightValue(null, true);
mLastHighlighted = null;
} else {
mChart.highlightValue(h, true);
mLastHighlighted = h;
}
}
示例3: performHighlightDrag
import com.github.mikephil.charting.highlight.Highlight; //導入方法依賴的package包/類
/**
* Highlights upon dragging, generates callbacks for the selection-listener.
*
* @param e
*/
private void performHighlightDrag(MotionEvent e) {
Highlight h = mChart.getHighlightByTouchPoint(e.getX(), e.getY());
if (h != null && !h.equalTo(mLastHighlighted)) {
mLastHighlighted = h;
mChart.highlightTouch(h);
}
}
示例4: performHighlight
import com.github.mikephil.charting.highlight.Highlight; //導入方法依賴的package包/類
/**
* Perform a highlight operation.
*
* @param e
*/
protected void performHighlight(Highlight h, MotionEvent e) {
if (h == null || h.equalTo(mLastHighlighted)) {
mChart.highlightTouch(null);
mLastHighlighted = null;
} else {
mLastHighlighted = h;
mChart.highlightTouch(h);
}
}
示例5: performHighlight
import com.github.mikephil.charting.highlight.Highlight; //導入方法依賴的package包/類
/**
* Perform a highlight operation.
*
* @param e
*/
private void performHighlight(MotionEvent e) {
Highlight h = mChart.getHighlightByTouchPoint(e.getX(), e.getY());
if (h == null || h.equalTo(mLastHighlighted)) {
mChart.highlightTouch(null);
mLastHighlighted = null;
} else {
mLastHighlighted = h;
mChart.highlightTouch(h);
}
}
示例6: onSingleTapUp
import com.github.mikephil.charting.highlight.Highlight; //導入方法依賴的package包/類
@Override
public boolean onSingleTapUp(MotionEvent e) {
OnChartGestureListener l = mChart.getOnChartGestureListener();
if (l != null) {
l.onChartSingleTapped(e);
}
float distance = mChart.distanceToCenter(e.getX(), e.getY());
// check if a slice was touched
if (distance > mChart.getRadius()) {
// if no slice was touched, highlight nothing
mChart.highlightValues(null);
mLastHighlighted = null;
} else {
float angle = mChart.getAngleForPoint(e.getX(), e.getY());
if (mChart instanceof PieChart) {
angle /= mChart.getAnimator().getPhaseY();
}
int index = mChart.getIndexForAngle(angle);
// check if the index could be found
if (index < 0) {
mChart.highlightValues(null);
mLastHighlighted = null;
} else {
List<SelectionDetail> valsAtIndex = mChart.getSelectionDetailsAtIndex(index);
int dataSetIndex = 0;
// get the dataset that is closest to the selection (PieChart
// only
// has one DataSet)
if (mChart instanceof RadarChart) {
dataSetIndex = Utils.getClosestDataSetIndex(valsAtIndex, distance
/ ((RadarChart) mChart).getFactor(), null);
}
if (dataSetIndex < 0) {
mChart.highlightValues(null);
mLastHighlighted = null;
} else {
Highlight h = new Highlight(index, dataSetIndex);
if (h.equalTo(mLastHighlighted)) {
mChart.highlightTouch(null);
mLastHighlighted = null;
} else {
mChart.highlightTouch(h);
mLastHighlighted = h;
}
}
}
}
return true;
}