本文整理汇总了Java中lecho.lib.hellocharts.model.Axis.isAutoGenerated方法的典型用法代码示例。如果您正苦于以下问题:Java Axis.isAutoGenerated方法的具体用法?Java Axis.isAutoGenerated怎么用?Java Axis.isAutoGenerated使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类lecho.lib.hellocharts.model.Axis
的用法示例。
在下文中一共展示了Axis.isAutoGenerated方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: initAxisMargin
import lecho.lib.hellocharts.model.Axis; //导入方法依赖的package包/类
private void initAxisMargin(Axis axis, int position) {
int margin = 0;
if (!axis.isInside() && (axis.isAutoGenerated() || !axis.getValues().isEmpty())) {
margin += axisMargin + labelDimensionForMarginsTab[position];
}
margin += getAxisNameMargin(axis, position);
insetContentRectWithAxesMargins(margin, position);
}
示例2: prepareAxisToDraw
import lecho.lib.hellocharts.model.Axis; //导入方法依赖的package包/类
private void prepareAxisToDraw(Axis axis, int position) {
if (axis.isAutoGenerated()) {
prepareAutoGeneratedAxis(axis, position);
} else {
prepareCustomAxis(axis, position);
}
}
示例3: initAxisMargin
import lecho.lib.hellocharts.model.Axis; //导入方法依赖的package包/类
private void initAxisMargin(Axis axis, int position) {
int margin = 0;
if (!axis.isInside() && (axis.isAutoGenerated() || !axis.getValues().isEmpty())) {
margin = 0 + (this.axisMargin + this.labelDimensionForMarginsTab[position]);
}
insetContentRectWithAxesMargins(margin + getAxisNameMargin(axis, position), position);
}
示例4: drawAxisLabelsAndName
import lecho.lib.hellocharts.model.Axis; //导入方法依赖的package包/类
private void drawAxisLabelsAndName(Canvas canvas, Axis axis, int position) {
float labelX, labelY;
labelX = labelY = 0;
boolean isAxisVertical = isAxisVertical(position);
if (LEFT == position || RIGHT == position) {
labelX = labelBaselineTab[position];
} else if (TOP == position || BOTTOM == position) {
labelY = labelBaselineTab[position];
}
for (int valueToDrawIndex = 0; valueToDrawIndex < valuesToDrawNumTab[position]; ++valueToDrawIndex) {
int charsNumber = 0;
if (axis.isAutoGenerated()) {
final float value = autoValuesToDrawTab[position][valueToDrawIndex];
charsNumber = axis.getFormatter().formatValueForAutoGeneratedAxis(labelBuffer, value,
autoValuesBufferTab[position].decimals);
} else {
AxisValue axisValue = valuesToDrawTab[position][valueToDrawIndex];
charsNumber = axis.getFormatter().formatValueForManualAxis(labelBuffer, axisValue);
}
if (isAxisVertical) {
labelY = rawValuesTab[position][valueToDrawIndex];
} else {
labelX = rawValuesTab[position][valueToDrawIndex];
}
if (axis.hasTiltedLabels()) {
canvas.save();
canvas.translate(tiltedLabelXTranslation[position], tiltedLabelYTranslation[position]);
canvas.rotate(-45, labelX, labelY);
canvas.drawText(labelBuffer, labelBuffer.length - charsNumber, charsNumber, labelX, labelY,
labelPaintTab[position]);
canvas.restore();
} else {
canvas.drawText(labelBuffer, labelBuffer.length - charsNumber, charsNumber, labelX, labelY,
labelPaintTab[position]);
}
}
// Drawing axis name
final Rect contentRectMargins = computator.getContentRectMinusAxesMargins();
if (!TextUtils.isEmpty(axis.getName())) {
if (isAxisVertical) {
canvas.save();
canvas.rotate(-90, contentRectMargins.centerY(), contentRectMargins.centerY());
canvas.drawText(axis.getName(), contentRectMargins.centerY(), nameBaselineTab[position],
namePaintTab[position]);
canvas.restore();
} else {
canvas.drawText(axis.getName(), contentRectMargins.centerX(), nameBaselineTab[position],
namePaintTab[position]);
}
}
}
示例5: drawAxisLabelsAndName
import lecho.lib.hellocharts.model.Axis; //导入方法依赖的package包/类
private void drawAxisLabelsAndName(Canvas canvas, Axis axis, int position) {
float labelY = 0.0f;
float labelX = 0.0f;
boolean isAxisVertical = isAxisVertical(position);
if (1 == position || 2 == position) {
labelX = this.labelBaselineTab[position];
} else if (position == 0 || 3 == position) {
labelY = this.labelBaselineTab[position];
}
for (int valueToDrawIndex = 0; valueToDrawIndex < this.valuesToDrawNumTab[position]; valueToDrawIndex++) {
int charsNumber;
if (axis.isAutoGenerated()) {
charsNumber = axis.getFormatter().formatValueForAutoGeneratedAxis(this.labelBuffer, this.autoValuesToDrawTab[position][valueToDrawIndex], this.autoValuesBufferTab[position].decimals);
} else {
charsNumber = axis.getFormatter().formatValueForManualAxis(this.labelBuffer, this.valuesToDrawTab[position][valueToDrawIndex]);
}
if (isAxisVertical) {
labelY = this.rawValuesTab[position][valueToDrawIndex];
} else {
labelX = this.rawValuesTab[position][valueToDrawIndex];
}
if (axis.hasTiltedLabels()) {
canvas.save();
canvas.translate((float) this.tiltedLabelXTranslation[position], (float) this.tiltedLabelYTranslation[position]);
canvas.rotate(-45.0f, labelX, labelY);
canvas.drawText(this.labelBuffer, this.labelBuffer.length - charsNumber, charsNumber, labelX, labelY, this.labelPaintTab[position]);
canvas.restore();
} else {
canvas.drawText(this.labelBuffer, this.labelBuffer.length - charsNumber, charsNumber, labelX, labelY, this.labelPaintTab[position]);
}
}
Rect contentRectMargins = this.computator.getContentRectMinusAxesMargins();
if (!TextUtils.isEmpty(axis.getName())) {
if (isAxisVertical) {
canvas.save();
canvas.rotate(-90.0f, (float) contentRectMargins.centerY(), (float) contentRectMargins.centerY());
canvas.drawText(axis.getName(), (float) contentRectMargins.centerY(), this.nameBaselineTab[position], this.namePaintTab[position]);
canvas.restore();
return;
}
canvas.drawText(axis.getName(), (float) contentRectMargins.centerX(), this.nameBaselineTab[position], this.namePaintTab[position]);
}
}