本文整理汇总了Java中com.github.mikephil.charting.utils.Utils.getNormalizedAngle方法的典型用法代码示例。如果您正苦于以下问题:Java Utils.getNormalizedAngle方法的具体用法?Java Utils.getNormalizedAngle怎么用?Java Utils.getNormalizedAngle使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.github.mikephil.charting.utils.Utils
的用法示例。
在下文中一共展示了Utils.getNormalizedAngle方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getIndexForAngle
import com.github.mikephil.charting.utils.Utils; //导入方法依赖的package包/类
@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
}
示例2: getIndexForAngle
import com.github.mikephil.charting.utils.Utils; //导入方法依赖的package包/类
@Override
public int getIndexForAngle(float angle) {
// take the current angle of the chart into consideration
float a = Utils.getNormalizedAngle(angle - getRotationAngle());
float sliceangle = getSliceAngle();
for (int i = 0; i < mData.getXValCount(); i++) {
if (sliceangle * (i + 1) - sliceangle / 2f > a)
return i;
}
return 0;
}
示例3: getIndexForAngle
import com.github.mikephil.charting.utils.Utils; //导入方法依赖的package包/类
@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;
}
示例4: setRotationAngle
import com.github.mikephil.charting.utils.Utils; //导入方法依赖的package包/类
/**
* 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);
}
示例5: setRotationAngle
import com.github.mikephil.charting.utils.Utils; //导入方法依赖的package包/类
/**
* 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);
}