当前位置: 首页>>代码示例>>Java>>正文


Java Utils.getSizeOfRotatedRectangleByDegrees方法代码示例

本文整理汇总了Java中com.github.mikephil.charting.utils.Utils.getSizeOfRotatedRectangleByDegrees方法的典型用法代码示例。如果您正苦于以下问题:Java Utils.getSizeOfRotatedRectangleByDegrees方法的具体用法?Java Utils.getSizeOfRotatedRectangleByDegrees怎么用?Java Utils.getSizeOfRotatedRectangleByDegrees使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.github.mikephil.charting.utils.Utils的用法示例。


在下文中一共展示了Utils.getSizeOfRotatedRectangleByDegrees方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: computeSize

import com.github.mikephil.charting.utils.Utils; //导入方法依赖的package包/类
@Override
protected void computeSize() {
    
    mAxisLabelPaint.setTypeface(mXAxis.getTypeface());
    mAxisLabelPaint.setTextSize(mXAxis.getTextSize());

    String longest = mXAxis.getLongestLabel();

    final FSize labelSize = Utils.calcTextSize(mAxisLabelPaint, longest);

    final float labelWidth = (int)(labelSize.width + mXAxis.getXOffset() * 3.5f);
    final float labelHeight = labelSize.height;

    final FSize labelRotatedSize = Utils.getSizeOfRotatedRectangleByDegrees(
            labelSize.width,
            labelHeight,
            mXAxis.getLabelRotationAngle());

    mXAxis.mLabelWidth = Math.round(labelWidth);
    mXAxis.mLabelHeight = Math.round(labelHeight);
    mXAxis.mLabelRotatedWidth = (int)(labelRotatedSize.width + mXAxis.getXOffset() * 3.5f);
    mXAxis.mLabelRotatedHeight = Math.round(labelRotatedSize.height);

    FSize.recycleInstance(labelRotatedSize);
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:26,代码来源:XAxisRendererHorizontalBarChart.java

示例2: computeSize

import com.github.mikephil.charting.utils.Utils; //导入方法依赖的package包/类
protected void computeSize() {

        String longest = mXAxis.getLongestLabel();

        mAxisLabelPaint.setTypeface(mXAxis.getTypeface());
        mAxisLabelPaint.setTextSize(mXAxis.getTextSize());

        final FSize labelSize = Utils.calcTextSize(mAxisLabelPaint, longest);

        final float labelWidth = labelSize.width;
        final float labelHeight = Utils.calcTextHeight(mAxisLabelPaint, "Q");

        final FSize labelRotatedSize = Utils.getSizeOfRotatedRectangleByDegrees(
                labelWidth,
                labelHeight,
                mXAxis.getLabelRotationAngle());


        mXAxis.mLabelWidth = Math.round(labelWidth);
        mXAxis.mLabelHeight = Math.round(labelHeight);
        mXAxis.mLabelRotatedWidth = Math.round(labelRotatedSize.width);
        mXAxis.mLabelRotatedHeight = Math.round(labelRotatedSize.height);

        FSize.recycleInstance(labelRotatedSize);
        FSize.recycleInstance(labelSize);
    }
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:27,代码来源:XAxisRenderer.java

示例3: computeAxis

import com.github.mikephil.charting.utils.Utils; //导入方法依赖的package包/类
@Override
public void computeAxis(float xValAverageLength, List<String> xValues) {
    
    mAxisLabelPaint.setTypeface(mXAxis.getTypeface());
    mAxisLabelPaint.setTextSize(mXAxis.getTextSize());
    mXAxis.setValues(xValues);

    String longest = mXAxis.getLongestLabel();

    final FSize labelSize = Utils.calcTextSize(mAxisLabelPaint, longest);

    final float labelWidth = (int)(labelSize.width + mXAxis.getXOffset() * 3.5f);
    final float labelHeight = labelSize.height;

    final FSize labelRotatedSize = Utils.getSizeOfRotatedRectangleByDegrees(
            labelSize.width,
            labelHeight,
            mXAxis.getLabelRotationAngle());

    mXAxis.mLabelWidth = Math.round(labelWidth);
    mXAxis.mLabelHeight = Math.round(labelHeight);
    mXAxis.mLabelRotatedWidth = (int)(labelRotatedSize.width + mXAxis.getXOffset() * 3.5f);
    mXAxis.mLabelRotatedHeight = Math.round(labelRotatedSize.height);
}
 
开发者ID:rahulmaddineni,项目名称:Stayfit,代码行数:25,代码来源:XAxisRendererHorizontalBarChart.java

示例4: computeAxis

import com.github.mikephil.charting.utils.Utils; //导入方法依赖的package包/类
public void computeAxis(float xValMaximumLength, List<String> xValues) {

        mAxisLabelPaint.setTypeface(mXAxis.getTypeface());
        mAxisLabelPaint.setTextSize(mXAxis.getTextSize());

        StringBuilder widthText = new StringBuilder();

        int xValChars = Math.round(xValMaximumLength);

        for (int i = 0; i < xValChars; i++) {
            widthText.append('h');
        }

        final FSize labelSize = Utils.calcTextSize(mAxisLabelPaint, widthText.toString());

        final float labelWidth = labelSize.width;
        final float labelHeight = Utils.calcTextHeight(mAxisLabelPaint, "Q");

        final FSize labelRotatedSize = Utils.getSizeOfRotatedRectangleByDegrees(
                labelWidth,
                labelHeight,
                mXAxis.getLabelRotationAngle());

        StringBuilder space = new StringBuilder();
        int xValSpaceChars = mXAxis.getSpaceBetweenLabels();

        for (int i = 0; i < xValSpaceChars; i++) {
            space.append('h');
        }

        final FSize spaceSize = Utils.calcTextSize(mAxisLabelPaint, space.toString());

        mXAxis.mLabelWidth = Math.round(labelWidth + spaceSize.width);
        mXAxis.mLabelHeight = Math.round(labelHeight);
        mXAxis.mLabelRotatedWidth = Math.round(labelRotatedSize.width + spaceSize.width);
        mXAxis.mLabelRotatedHeight = Math.round(labelRotatedSize.height);

        mXAxis.setValues(xValues);
    }
 
开发者ID:rahulmaddineni,项目名称:Stayfit,代码行数:40,代码来源:XAxisRenderer.java


注:本文中的com.github.mikephil.charting.utils.Utils.getSizeOfRotatedRectangleByDegrees方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。