com.github.mikephil.charting.utils.Utils.getNormalizedAngle()方法的使用及代码示例

x33g5p2x  于2022-02-01 转载在 其他  
字(5.4k)|赞(0)|评价(0)|浏览(120)

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

Utils.getNormalizedAngle介绍

[英]returns an angle between 0.f < 360.f (not less than zero, less than 360)
[中]返回介于0之间的角度。f<360。f(不小于零,小于360)

代码示例

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

/**
 * Set an offset for the rotation of the RadarChart in degrees. Default 270f
 * --> top (NORTH)
 *
 * @param angle
 */
public void setRotationAngle(float angle) {
  mRawRotationAngle = angle;
  mRotationAngle = Utils.getNormalizedAngle(mRawRotationAngle);
}

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

@Override
public int getIndexForAngle(float angle) {
  // take the current angle of the chart into consideration
  float a = Utils.getNormalizedAngle(angle - getRotationAngle());
  for (int i = 0; i < mAbsoluteAngles.length; i++) {
    if (mAbsoluteAngles[i] > a)
      return i;
  }
  return -1; // return -1 if no index found
}

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

@Override
public int getIndexForAngle(float angle) {
  // take the current angle of the chart into consideration
  float a = Utils.getNormalizedAngle(angle - getRotationAngle());
  float sliceangle = getSliceAngle();
  int max = mData.getMaxEntryCountSet().getEntryCount();
  int index = 0;
  for (int i = 0; i < max; i++) {
    float referenceAngle = sliceangle * (i + 1) - sliceangle / 2f;
    if (referenceAngle > a) {
      index = i;
      break;
    }
  }
  return index;
}

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

/**
 * Set an offset for the rotation of the RadarChart in degrees. Default 270f
 * --> top (NORTH)
 *
 * @param angle
 */
public void setRotationAngle(float angle) {
  mRawRotationAngle = angle;
  mRotationAngle = Utils.getNormalizedAngle(mRawRotationAngle);
}

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

/**
 * Set an offset for the rotation of the RadarChart in degrees. Default 270f
 * --> top (NORTH)
 *
 * @param angle
 */
public void setRotationAngle(float angle) {
  mRawRotationAngle = angle;
  mRotationAngle = Utils.getNormalizedAngle(mRawRotationAngle);
}

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

/**
 * Set an offset for the rotation of the RadarChart in degrees. Default 270f
 * --> top (NORTH)
 *
 * @param angle
 */
public void setRotationAngle(float angle) {
  mRawRotationAngle = angle;
  mRotationAngle = Utils.getNormalizedAngle(mRawRotationAngle);
}

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

/**
 * Set an offset for the rotation of the RadarChart in degrees. Default 270f
 * --> top (NORTH)
 *
 * @param angle
 */
public void setRotationAngle(float angle) {
  mRawRotationAngle = angle;
  mRotationAngle = Utils.getNormalizedAngle(mRawRotationAngle);
}

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

@Override
public int getIndexForAngle(float angle) {
  // take the current angle of the chart into consideration
  float a = Utils.getNormalizedAngle(angle - getRotationAngle());
  for (int i = 0; i < mAbsoluteAngles.length; i++) {
    if (mAbsoluteAngles[i] > a)
      return i;
  }
  return -1; // return -1 if no index found
}

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

@Override
public int getIndexForAngle(float angle) {
  // take the current angle of the chart into consideration
  float a = Utils.getNormalizedAngle(angle - getRotationAngle());
  for (int i = 0; i < mAbsoluteAngles.length; i++) {
    if (mAbsoluteAngles[i] > a) {
      return i;
    }
  }
  return -1; // return -1 if no index found
}

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

@Override
public int getIndexForAngle(float angle) {
  // take the current angle of the chart into consideration
  float a = Utils.getNormalizedAngle(angle - getRotationAngle());
  for (int i = 0; i < mAbsoluteAngles.length; i++) {
    if (mAbsoluteAngles[i] > a)
      return i;
  }
  return -1; // return -1 if no index found
}

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

@Override
public int getIndexForAngle(float angle) {
  // take the current angle of the chart into consideration
  float a = Utils.getNormalizedAngle(angle - getRotationAngle());
  for (int i = 0; i < mAbsoluteAngles.length; i++) {
    if (mAbsoluteAngles[i] > a)
      return i;
  }
  return -1; // return -1 if no index found
}

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

@Override
public int getIndexForAngle(float angle) {
  // take the current angle of the chart into consideration
  float a = Utils.getNormalizedAngle(angle - getRotationAngle());
  float sliceangle = getSliceAngle();
  int max = mData.getMaxEntryCountSet().getEntryCount();
  int index = 0;
  for (int i = 0; i < max; i++) {
    float referenceAngle = sliceangle * (i + 1) - sliceangle / 2f;
    if (referenceAngle > a) {
      index = i;
      break;
    }
  }
  return index;
}

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

@Override
public int getIndexForAngle(float angle) {
  // take the current angle of the chart into consideration
  float a = Utils.getNormalizedAngle(angle - getRotationAngle());
  float sliceangle = getSliceAngle();
  int max = mData.getMaxEntryCountSet().getEntryCount();
  int index = 0;
  for (int i = 0; i < max; i++) {
    float referenceAngle = sliceangle * (i + 1) - sliceangle / 2f;
    if (referenceAngle > a) {
      index = i;
      break;
    }
  }
  return index;
}

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

@Override
public int getIndexForAngle(float angle) {
  // take the current angle of the chart into consideration
  float a = Utils.getNormalizedAngle(angle - getRotationAngle());
  float sliceangle = getSliceAngle();
  int max = mData.getMaxEntryCountSet().getEntryCount();
  int index = 0;
  for (int i = 0; i < max; i++) {
    float referenceAngle = sliceangle * (i + 1) - sliceangle / 2f;
    if (referenceAngle > a) {
      index = i;
      break;
    }
  }
  return index;
}

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

@Override
public int getIndexForAngle(float angle) {
  // take the current angle of the chart into consideration
  float a = Utils.getNormalizedAngle(angle - getRotationAngle());
  float sliceangle = getSliceAngle();
  int max = mData.getMaxEntryCountSet().getEntryCount();
  int index = 0;
  for (int i = 0; i < max; i++) {
    float referenceAngle = sliceangle * (i + 1) - sliceangle / 2f;
    if (referenceAngle > a) {
      index = i;
      break;
    }
  }
  return index;
}

相关文章