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


Java IBarDataSet.getBarBorderWidth方法代码示例

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


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

示例1: drawDataSet

import com.github.mikephil.charting.interfaces.datasets.IBarDataSet; //导入方法依赖的package包/类
@Override
protected void drawDataSet(Canvas c, IBarDataSet dataSet, int index) {

    Transformer trans = mChart.getTransformer(dataSet.getAxisDependency());

    mShadowPaint.setColor(dataSet.getBarShadowColor());
    mBarBorderPaint.setColor(dataSet.getBarBorderColor());
    mBarBorderPaint.setStrokeWidth(Utils.convertDpToPixel(dataSet.getBarBorderWidth()));

    final boolean drawBorder = dataSet.getBarBorderWidth() > 0.f;

    float phaseX = mAnimator.getPhaseX();
    float phaseY = mAnimator.getPhaseY();

    // initialize the buffer
    BarBuffer buffer = mBarBuffers[index];
    buffer.setPhases(phaseX, phaseY);
    buffer.setBarSpace(dataSet.getBarSpace());
    buffer.setDataSet(index);
    buffer.setInverted(mChart.isInverted(dataSet.getAxisDependency()));

    buffer.feed(dataSet);

    trans.pointValuesToPixel(buffer.buffer);

    for (int j = 0; j < buffer.size(); j += 4) {

        if (!mViewPortHandler.isInBoundsTop(buffer.buffer[j + 3]))
            break;

        if (!mViewPortHandler.isInBoundsBottom(buffer.buffer[j + 1]))
            continue;

        if (mChart.isDrawBarShadowEnabled()) {
            c.drawRect(mViewPortHandler.contentLeft(), buffer.buffer[j + 1],
                    mViewPortHandler.contentRight(),
                    buffer.buffer[j + 3], mShadowPaint);
        }

        // Set the color for the currently drawn value. If the index
        // is out of bounds, reuse colors.
        mRenderPaint.setColor(dataSet.getColor(j / 4));
        c.drawRect(buffer.buffer[j], buffer.buffer[j + 1], buffer.buffer[j + 2],
                buffer.buffer[j + 3], mRenderPaint);

        if (drawBorder) {
            c.drawRect(buffer.buffer[j], buffer.buffer[j + 1], buffer.buffer[j + 2],
                    buffer.buffer[j + 3], mBarBorderPaint);
        }
    }
}
 
开发者ID:pencil-box,项目名称:NetKnight,代码行数:52,代码来源:HorizontalBarChartRenderer.java

示例2: drawDataSet

import com.github.mikephil.charting.interfaces.datasets.IBarDataSet; //导入方法依赖的package包/类
@Override
protected void drawDataSet(Canvas c, IBarDataSet dataSet, int index) {

    Transformer trans = mChart.getTransformer(dataSet.getAxisDependency());

    mShadowPaint.setColor(dataSet.getBarShadowColor());
    mBarBorderPaint.setColor(dataSet.getBarBorderColor());
    mBarBorderPaint.setStrokeWidth(Utils.convertDpToPixel(dataSet.getBarBorderWidth()));

    final boolean drawBorder = dataSet.getBarBorderWidth() > 0.f;

    float phaseX = mAnimator.getPhaseX();
    float phaseY = mAnimator.getPhaseY();

    // initialize the buffer
    BarBuffer buffer = mBarBuffers[index];
    buffer.setPhases(phaseX, phaseY);
    buffer.setDataSet(index);
    buffer.setInverted(mChart.isInverted(dataSet.getAxisDependency()));
    buffer.setBarWidth(mChart.getBarData().getBarWidth());

    buffer.feed(dataSet);

    trans.pointValuesToPixel(buffer.buffer);

    for (int j = 0; j < buffer.size(); j += 4) {

        if (!mViewPortHandler.isInBoundsTop(buffer.buffer[j + 3]))
            break;

        if (!mViewPortHandler.isInBoundsBottom(buffer.buffer[j + 1]))
            continue;

        if (mChart.isDrawBarShadowEnabled()) {
            c.drawRect(mViewPortHandler.contentLeft(), buffer.buffer[j + 1],
                    mViewPortHandler.contentRight(),
                    buffer.buffer[j + 3], mShadowPaint);
        }

        // Set the color for the currently drawn value. If the index
        // is out of bounds, reuse colors.
        mRenderPaint.setColor(dataSet.getColor(j / 4));
        c.drawRect(buffer.buffer[j], buffer.buffer[j + 1], buffer.buffer[j + 2],
                buffer.buffer[j + 3], mRenderPaint);

        if (drawBorder) {
            c.drawRect(buffer.buffer[j], buffer.buffer[j + 1], buffer.buffer[j + 2],
                    buffer.buffer[j + 3], mBarBorderPaint);
        }
    }
}
 
开发者ID:letolab,项目名称:LETO-Toggl_Android,代码行数:52,代码来源:HorizontalBarChartRenderer.java

示例3: drawDataSet

import com.github.mikephil.charting.interfaces.datasets.IBarDataSet; //导入方法依赖的package包/类
@Override
protected void drawDataSet(Canvas c, IBarDataSet dataSet, int index) {

    Transformer trans = mChart.getTransformer(dataSet.getAxisDependency());

    mShadowPaint.setColor(dataSet.getBarShadowColor());
    mBarBorderPaint.setColor(dataSet.getBarBorderColor());
    mBarBorderPaint.setStrokeWidth(dataSet.getBarBorderWidth());

    final boolean drawBorder = dataSet.getBarBorderWidth() > 0.f;

    float phaseX = mAnimator.getPhaseX();
    float phaseY = mAnimator.getPhaseY();

    // initialize the buffer
    BarBuffer buffer = mBarBuffers[index];
    buffer.setPhases(phaseX, phaseY);
    buffer.setBarSpace(dataSet.getBarSpace());
    buffer.setDataSet(index);
    buffer.setInverted(mChart.isInverted(dataSet.getAxisDependency()));

    buffer.feed(dataSet);

    trans.pointValuesToPixel(buffer.buffer);

    for (int j = 0; j < buffer.size(); j += 4) {

        if (!mViewPortHandler.isInBoundsTop(buffer.buffer[j + 3]))
            break;

        if (!mViewPortHandler.isInBoundsBottom(buffer.buffer[j + 1]))
            continue;

        if (mChart.isDrawBarShadowEnabled()) {
            c.drawRect(mViewPortHandler.contentLeft(), buffer.buffer[j + 1],
                    mViewPortHandler.contentRight(),
                    buffer.buffer[j + 3], mShadowPaint);
        }

        // Set the color for the currently drawn value. If the index
        // is out of bounds, reuse colors.
        mRenderPaint.setColor(dataSet.getColor(j / 4));
        c.drawRect(buffer.buffer[j], buffer.buffer[j + 1], buffer.buffer[j + 2],
                buffer.buffer[j + 3], mRenderPaint);

        if (drawBorder) {
            c.drawRect(buffer.buffer[j], buffer.buffer[j + 1], buffer.buffer[j + 2],
                    buffer.buffer[j + 3], mBarBorderPaint);
        }
    }
}
 
开发者ID:muyoumumumu,项目名称:QuShuChe,代码行数:52,代码来源:HorizontalBarChartRenderer.java


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