YAxisRendererHorizontalBarChart.java 文件源码

java
阅读 43 收藏 0 点赞 0 评论 0

项目:GitHub 作者:
/**
 * draws the y-labels on the specified x-position
 *
 * @param fixedPosition
 * @param positions
 */
@Override
protected void drawYLabels(Canvas c, float fixedPosition, float[] positions, float offset) {

    mAxisLabelPaint.setTypeface(mYAxis.getTypeface());
    mAxisLabelPaint.setTextSize(mYAxis.getTextSize());
    mAxisLabelPaint.setColor(mYAxis.getTextColor());

    final int from = mYAxis.isDrawBottomYLabelEntryEnabled() ? 0 : 1;
    final int to = mYAxis.isDrawTopYLabelEntryEnabled()
            ? mYAxis.mEntryCount
            : (mYAxis.mEntryCount - 1);

    for (int i = from; i < to; i++) {

        String text = mYAxis.getFormattedLabel(i);

        c.drawText(text, positions[i * 2], fixedPosition - offset, mAxisLabelPaint);
    }
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号