當前位置: 首頁>>代碼示例>>Java>>正文


Java Highlight.equalTo方法代碼示例

本文整理匯總了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);
    }
}
 
開發者ID:weiwenqiang,項目名稱:GitHub,代碼行數:15,代碼來源:BarLineChartTouchListener.java

示例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;
    }
}
 
開發者ID:weiwenqiang,項目名稱:GitHub,代碼行數:16,代碼來源:ChartTouchListener.java

示例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);
    }
}
 
開發者ID:rahulmaddineni,項目名稱:Stayfit,代碼行數:15,代碼來源:BarLineChartTouchListener.java

示例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);
    }
}
 
開發者ID:rahulmaddineni,項目名稱:Stayfit,代碼行數:16,代碼來源:ChartTouchListener.java

示例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);
    }
}
 
開發者ID:xinpengfei520,項目名稱:P2P,代碼行數:18,代碼來源:BarLineChartTouchListener.java

示例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;
}
 
開發者ID:xinpengfei520,項目名稱:P2P,代碼行數:71,代碼來源:PieRadarChartTouchListener.java


注:本文中的com.github.mikephil.charting.highlight.Highlight.equalTo方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。