com.github.mikephil.charting.charts.BarChart.getHighlighter()方法的使用及代码示例

x33g5p2x  于2022-01-17 转载在 其他  
字(3.3k)|赞(0)|评价(0)|浏览(108)

本文整理了Java中com.github.mikephil.charting.charts.BarChart.getHighlighter()方法的一些代码示例,展示了BarChart.getHighlighter()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。BarChart.getHighlighter()方法的具体详情如下:
包路径:com.github.mikephil.charting.charts.BarChart
类名称:BarChart
方法名:getHighlighter

BarChart.getHighlighter介绍

暂无

代码示例

代码示例来源:origin: PhilJay/MPAndroidChart

/**
 * Returns the Highlight object (contains x-index and DataSet index) of the selected value at the given touch
 * point
 * inside the BarChart.
 *
 * @param x
 * @param y
 * @return
 */
@Override
public Highlight getHighlightByTouchPoint(float x, float y) {
  if (mData == null) {
    Log.e(LOG_TAG, "Can't select by touch. No data set.");
    return null;
  } else {
    Highlight h = getHighlighter().getHighlight(x, y);
    if (h == null || !isHighlightFullBarEnabled()) return h;
    // For isHighlightFullBarEnabled, remove stackIndex
    return new Highlight(h.getX(), h.getY(),
        h.getXPx(), h.getYPx(),
        h.getDataSetIndex(), -1, h.getAxis());
  }
}

代码示例来源:origin: WenWangAndroid/ChartManager

/**
 * Returns the Highlight object (contains x-index and DataSet index) of the selected value at the given touch
 * point
 * inside the BarChart.
 *
 * @param x
 * @param y
 * @return
 */
@Override
public Highlight getHighlightByTouchPoint(float x, float y) {
  if (mData == null) {
    Log.e(LOG_TAG, "Can't select by touch. No data set.");
    return null;
  } else {
    Highlight h = getHighlighter().getHighlight(x, y);
    if (h == null || !isHighlightFullBarEnabled()) return h;
    // For isHighlightFullBarEnabled, remove stackIndex
    return new Highlight(h.getX(), h.getY(),
        h.getXPx(), h.getYPx(),
        h.getDataSetIndex(), -1, h.getAxis());
  }
}

代码示例来源:origin: com.github.PhilJay/MPAndroidChart

/**
 * Returns the Highlight object (contains x-index and DataSet index) of the selected value at the given touch
 * point
 * inside the BarChart.
 *
 * @param x
 * @param y
 * @return
 */
@Override
public Highlight getHighlightByTouchPoint(float x, float y) {
  if (mData == null) {
    Log.e(LOG_TAG, "Can't select by touch. No data set.");
    return null;
  } else {
    Highlight h = getHighlighter().getHighlight(x, y);
    if (h == null || !isHighlightFullBarEnabled()) return h;
    // For isHighlightFullBarEnabled, remove stackIndex
    return new Highlight(h.getX(), h.getY(),
        h.getXPx(), h.getYPx(),
        h.getDataSetIndex(), -1, h.getAxis());
  }
}

代码示例来源:origin: xiaolongonly/Ticket-Analysis

/**
 * Returns the Highlight object (contains x-index and DataSet index) of the selected value at the given touch
 * point
 * inside the BarChart.
 *
 * @param x
 * @param y
 * @return
 */
@Override
public Highlight getHighlightByTouchPoint(float x, float y) {
  if (mData == null) {
    Log.e(LOG_TAG, "Can't select by touch. No data set.");
    return null;
  } else {
    Highlight h = getHighlighter().getHighlight(x, y);
    if (h == null || !isHighlightFullBarEnabled()) return h;
    // For isHighlightFullBarEnabled, remove stackIndex
    return new Highlight(h.getX(), h.getY(),
        h.getXPx(), h.getYPx(),
        h.getDataSetIndex(), -1, h.getAxis());
  }
}

代码示例来源:origin: WallaceXiao/StockChart-MPAndroidChart

/**
 * Returns the Highlight object (contains x-index and DataSet index) of the selected value at the given touch
 * point
 * inside the BarChart.
 *
 * @param x
 * @param y
 * @return
 */
@Override
public Highlight getHighlightByTouchPoint(float x, float y) {
  if (mData == null) {
    Log.e(LOG_TAG, "Can't select by touch. No data set.");
    return null;
  } else {
    Highlight h = getHighlighter().getHighlight(x, y);
    if (h == null || !isHighlightFullBarEnabled()) {
      return h;
    }
    // For isHighlightFullBarEnabled, remove stackIndex
    return new Highlight(h.getX(), h.getY(),
        h.getXPx(), h.getYPx(),
        h.getDataSetIndex(), -1, h.getAxis());
  }
}

相关文章

微信公众号

最新文章

更多