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


Java XAxisPosition.BOTH_SIDED属性代码示例

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


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

示例1: renderAxisLine

@Override
public void renderAxisLine(Canvas c) {

    if (!mXAxis.isDrawAxisLineEnabled() || !mXAxis.isEnabled())
        return;

    mAxisLinePaint.setColor(mXAxis.getAxisLineColor());
    mAxisLinePaint.setStrokeWidth(mXAxis.getAxisLineWidth());

    if (mXAxis.getPosition() == XAxisPosition.TOP
            || mXAxis.getPosition() == XAxisPosition.TOP_INSIDE
            || mXAxis.getPosition() == XAxisPosition.BOTH_SIDED) {
        c.drawLine(mViewPortHandler.contentRight(),
                mViewPortHandler.contentTop(), mViewPortHandler.contentRight(),
                mViewPortHandler.contentBottom(), mAxisLinePaint);
    }

    if (mXAxis.getPosition() == XAxisPosition.BOTTOM
            || mXAxis.getPosition() == XAxisPosition.BOTTOM_INSIDE
            || mXAxis.getPosition() == XAxisPosition.BOTH_SIDED) {
        c.drawLine(mViewPortHandler.contentLeft(),
                mViewPortHandler.contentTop(), mViewPortHandler.contentLeft(),
                mViewPortHandler.contentBottom(), mAxisLinePaint);
    }
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:25,代码来源:XAxisRendererHorizontalBarChart.java

示例2: renderAxisLine

@Override
public void renderAxisLine(Canvas c) {

    if (!mXAxis.isDrawAxisLineEnabled() || !mXAxis.isEnabled())
        return;

    mAxisLinePaint.setColor(mXAxis.getAxisLineColor());
    mAxisLinePaint.setStrokeWidth(mXAxis.getAxisLineWidth());
    mAxisLinePaint.setPathEffect(mXAxis.getAxisLineDashPathEffect());

    if (mXAxis.getPosition() == XAxisPosition.TOP
            || mXAxis.getPosition() == XAxisPosition.TOP_INSIDE
            || mXAxis.getPosition() == XAxisPosition.BOTH_SIDED) {
        c.drawLine(mViewPortHandler.contentLeft(),
                mViewPortHandler.contentTop(), mViewPortHandler.contentRight(),
                mViewPortHandler.contentTop(), mAxisLinePaint);
    }

    if (mXAxis.getPosition() == XAxisPosition.BOTTOM
            || mXAxis.getPosition() == XAxisPosition.BOTTOM_INSIDE
            || mXAxis.getPosition() == XAxisPosition.BOTH_SIDED) {
        c.drawLine(mViewPortHandler.contentLeft(),
                mViewPortHandler.contentBottom(), mViewPortHandler.contentRight(),
                mViewPortHandler.contentBottom(), mAxisLinePaint);
    }
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:26,代码来源:XAxisRenderer.java

示例3: renderAxisLine

@Override
public void renderAxisLine(Canvas c) {

    if (!mXAxis.isDrawAxisLineEnabled() || !mXAxis.isEnabled())
        return;

    mAxisLinePaint.setColor(mXAxis.getAxisLineColor());
    mAxisLinePaint.setStrokeWidth(mXAxis.getAxisLineWidth());

    if (mXAxis.getPosition() == XAxisPosition.TOP
            || mXAxis.getPosition() == XAxisPosition.TOP_INSIDE
            || mXAxis.getPosition() == XAxisPosition.BOTH_SIDED) {
        c.drawLine(mViewPortHandler.contentLeft(),
                mViewPortHandler.contentTop(), mViewPortHandler.contentRight(),
                mViewPortHandler.contentTop(), mAxisLinePaint);
    }

    if (mXAxis.getPosition() == XAxisPosition.BOTTOM
            || mXAxis.getPosition() == XAxisPosition.BOTTOM_INSIDE
            || mXAxis.getPosition() == XAxisPosition.BOTH_SIDED) {
        c.drawLine(mViewPortHandler.contentLeft(),
                mViewPortHandler.contentBottom(), mViewPortHandler.contentRight(),
                mViewPortHandler.contentBottom(), mAxisLinePaint);
    }
}
 
开发者ID:rahulmaddineni,项目名称:Stayfit,代码行数:25,代码来源:XAxisRenderer.java

示例4: calculateOffsets

@Override
public void calculateOffsets() {

    if (!mCustomViewPortEnabled) {

        float offsetLeft = 0f, offsetRight = 0f, offsetTop = 0f, offsetBottom = 0f;

        calculateLegendOffsets(mOffsetsBuffer);

        offsetLeft += mOffsetsBuffer.left;
        offsetTop += mOffsetsBuffer.top;
        offsetRight += mOffsetsBuffer.right;
        offsetBottom += mOffsetsBuffer.bottom;

        // offsets for y-labels
        if (mAxisLeft.needsOffset()) {
            offsetLeft += mAxisLeft.getRequiredWidthSpace(mAxisRendererLeft
                    .getPaintAxisLabels());
        }

        if (mAxisRight.needsOffset()) {
            offsetRight += mAxisRight.getRequiredWidthSpace(mAxisRendererRight
                    .getPaintAxisLabels());
        }

        if (mXAxis.isEnabled() && mXAxis.isDrawLabelsEnabled()) {

            float xlabelheight = mXAxis.mLabelRotatedHeight + mXAxis.getYOffset();

            // offsets for x-labels
            if (mXAxis.getPosition() == XAxisPosition.BOTTOM) {

                offsetBottom += xlabelheight;

            } else if (mXAxis.getPosition() == XAxisPosition.TOP) {

                offsetTop += xlabelheight;

            } else if (mXAxis.getPosition() == XAxisPosition.BOTH_SIDED) {

                offsetBottom += xlabelheight;
                offsetTop += xlabelheight;
            }
        }

        offsetTop += getExtraTopOffset();
        offsetRight += getExtraRightOffset();
        offsetBottom += getExtraBottomOffset();
        offsetLeft += getExtraLeftOffset();

        float minOffset = Utils.convertDpToPixel(mMinOffset);

        mViewPortHandler.restrainViewPort(
                Math.max(minOffset, offsetLeft),
                Math.max(minOffset, offsetTop),
                Math.max(minOffset, offsetRight),
                Math.max(minOffset, offsetBottom));

        if (mLogEnabled) {
            Log.i(LOG_TAG, "offsetLeft: " + offsetLeft + ", offsetTop: " + offsetTop
                    + ", offsetRight: " + offsetRight + ", offsetBottom: " + offsetBottom);
            Log.i(LOG_TAG, "Content: " + mViewPortHandler.getContentRect().toString());
        }
    }

    prepareOffsetMatrix();
    prepareValuePxMatrix();
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:68,代码来源:BarLineChartBase.java

示例5: calculateOffsets

@Override
public void calculateOffsets() {

    float offsetLeft = 0f, offsetRight = 0f, offsetTop = 0f, offsetBottom = 0f;

    calculateLegendOffsets(mOffsetsBuffer);

    offsetLeft += mOffsetsBuffer.left;
    offsetTop += mOffsetsBuffer.top;
    offsetRight += mOffsetsBuffer.right;
    offsetBottom += mOffsetsBuffer.bottom;

    // offsets for y-labels
    if (mAxisLeft.needsOffset()) {
        offsetTop += mAxisLeft.getRequiredHeightSpace(mAxisRendererLeft.getPaintAxisLabels());
    }

    if (mAxisRight.needsOffset()) {
        offsetBottom += mAxisRight.getRequiredHeightSpace(mAxisRendererRight.getPaintAxisLabels());
    }

    float xlabelwidth = mXAxis.mLabelRotatedWidth;

    if (mXAxis.isEnabled()) {

        // offsets for x-labels
        if (mXAxis.getPosition() == XAxisPosition.BOTTOM) {

            offsetLeft += xlabelwidth;

        } else if (mXAxis.getPosition() == XAxisPosition.TOP) {

            offsetRight += xlabelwidth;

        } else if (mXAxis.getPosition() == XAxisPosition.BOTH_SIDED) {

            offsetLeft += xlabelwidth;
            offsetRight += xlabelwidth;
        }
    }

    offsetTop += getExtraTopOffset();
    offsetRight += getExtraRightOffset();
    offsetBottom += getExtraBottomOffset();
    offsetLeft += getExtraLeftOffset();

    float minOffset = Utils.convertDpToPixel(mMinOffset);

    mViewPortHandler.restrainViewPort(
            Math.max(minOffset, offsetLeft),
            Math.max(minOffset, offsetTop),
            Math.max(minOffset, offsetRight),
            Math.max(minOffset, offsetBottom));

    if (mLogEnabled) {
        Log.i(LOG_TAG, "offsetLeft: " + offsetLeft + ", offsetTop: " + offsetTop + ", offsetRight: " +
                offsetRight + ", offsetBottom: "
                + offsetBottom);
        Log.i(LOG_TAG, "Content: " + mViewPortHandler.getContentRect().toString());
    }

    prepareOffsetMatrix();
    prepareValuePxMatrix();
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:64,代码来源:HorizontalBarChart.java

示例6: calculateOffsets

@Override
public void calculateOffsets() {

	float offsetLeft = 0f, offsetRight = 0f, offsetTop = 0f, offsetBottom = 0f;

	calculateLegendOffsets(mOffsetsBuffer);

	offsetLeft += mOffsetsBuffer.left;
	offsetTop += mOffsetsBuffer.top;
	offsetRight += mOffsetsBuffer.right;
	offsetBottom += mOffsetsBuffer.bottom;

	// offsets for y-labels
	if (mAxisLeft.needsOffset()) {
		offsetTop += mAxisLeft.getRequiredHeightSpace(mAxisRendererLeft.getPaintAxisLabels());
	}

	if (mAxisRight.needsOffset()) {
		offsetBottom += mAxisRight.getRequiredHeightSpace(mAxisRendererRight.getPaintAxisLabels());
	}

	float xlabelwidth = mXAxis.mLabelRotatedWidth;

	if (mXAxis.isEnabled()) {

		// offsets for x-labels
		if (mXAxis.getPosition() == XAxisPosition.BOTTOM) {

			offsetLeft += xlabelwidth;

		} else if (mXAxis.getPosition() == XAxisPosition.TOP) {

			offsetRight += xlabelwidth;

		} else if (mXAxis.getPosition() == XAxisPosition.BOTH_SIDED) {

			offsetLeft += xlabelwidth;
			offsetRight += xlabelwidth;
		}
	}

	offsetTop += getExtraTopOffset();
	offsetRight += getExtraRightOffset();
	offsetBottom += getExtraBottomOffset();
	offsetLeft += getExtraLeftOffset();

	float minOffset = Utils.convertDpToPixel(mMinOffset);

	mViewPortHandler.restrainViewPort(
			Math.max(minOffset, offsetLeft),
			Math.max(minOffset, offsetTop),
			Math.max(minOffset, offsetRight),
			Math.max(minOffset, offsetBottom));

	if (mLogEnabled) {
		Log.i(LOG_TAG, "offsetLeft: " + offsetLeft + ", offsetTop: " + offsetTop + ", offsetRight: " + offsetRight + ", offsetBottom: "
				+ offsetBottom);
		Log.i(LOG_TAG, "Content: " + mViewPortHandler.getContentRect().toString());
	}

	prepareOffsetMatrix();
	prepareValuePxMatrix();
}
 
开发者ID:pencil-box,项目名称:NetKnight,代码行数:63,代码来源:HorizontalBarChart.java


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