本文整理汇总了Java中lecho.lib.hellocharts.model.Axis.setAutoGenerated方法的典型用法代码示例。如果您正苦于以下问题:Java Axis.setAutoGenerated方法的具体用法?Java Axis.setAutoGenerated怎么用?Java Axis.setAutoGenerated使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类lecho.lib.hellocharts.model.Axis
的用法示例。
在下文中一共展示了Axis.setAutoGenerated方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: basalVsTempBasalyAxis
import lecho.lib.hellocharts.model.Axis; //导入方法依赖的package包/类
public Axis basalVsTempBasalyAxis() {
Axis yAxis = new Axis();
yAxis.setAutoGenerated(false);
List<AxisValue> axisValues = new ArrayList<>();
for(double j = -maxBasal.intValue(); j <= maxBasal.intValue(); j += 1) {
//axisValues.add(new AxisValue((float)fitIOB2COBRange(j)));
AxisValue value = new AxisValue((float)j);
if (j==0){
value.setLabel("Basal");
} else if (j>0){
value.setLabel("+" + String.valueOf(j) + "u");
} else {
value.setLabel(String.valueOf(j) + "u");
}
axisValues.add(value);
}
yAxis.setValues(axisValues);
yAxis.setHasLines(true);
yAxis.setMaxLabelChars(5);
yAxis.setInside(true);
return yAxis;
}
示例2: iobPastyAxis
import lecho.lib.hellocharts.model.Axis; //导入方法依赖的package包/类
public Axis iobPastyAxis() {
Axis yAxis = new Axis();
yAxis.setAutoGenerated(false);
List<AxisValue> axisValues = new ArrayList<AxisValue>();
for(int j = 1; j <= 8; j += 1) {
//axisValues.add(new AxisValue((float)fitIOB2COBRange(j)));
AxisValue value = new AxisValue(j*10);
value.setLabel(String.valueOf(j*2) + "u");
axisValues.add(value);
}
yAxis.setTextColor(ChartUtils.COLOR_BLUE);
yAxis.setValues(axisValues);
yAxis.setHasLines(true);
yAxis.setMaxLabelChars(5);
yAxis.setInside(true);
return yAxis;
}
示例3: cobPastyAxis
import lecho.lib.hellocharts.model.Axis; //导入方法依赖的package包/类
public Axis cobPastyAxis() {
Axis yAxis = new Axis();
yAxis.setAutoGenerated(false);
List<AxisValue> axisValues = new ArrayList<AxisValue>();
for(int j = 1; j <= 8; j += 1) {
AxisValue value = new AxisValue(j*10);
value.setLabel(String.valueOf(j*10) + "g");
axisValues.add(value);
}
yAxis.setTextColor(ChartUtils.COLOR_ORANGE);
yAxis.setValues(axisValues);
yAxis.setHasLines(true);
yAxis.setMaxLabelChars(5);
yAxis.setInside(true);
return yAxis;
}
示例4: updateChart
import lecho.lib.hellocharts.model.Axis; //导入方法依赖的package包/类
private void updateChart(Cursor data) {
List<AxisValue> axisValuesX = new ArrayList<>();
List<PointValue> pointValues = new ArrayList<>();
int counter = -1;
do {
counter++;
String date = data.getString(data.getColumnIndex(
QuoteHistoricalDataColumns.DATE));
String bidPrice = data.getString(data.getColumnIndex(
QuoteHistoricalDataColumns.BIDPRICE));
// We have to show chart in right order.
int x = data.getCount() - 1 - counter;
// Point for line chart (date, price).
PointValue pointValue = new PointValue(x, Float.valueOf(bidPrice));
pointValue.setLabel(date);
pointValues.add(pointValue);
// Set labels for x-axis (we have to reduce its number to avoid overlapping text).
if (counter != 0 && counter % (data.getCount() / 3) == 0) {
AxisValue axisValueX = new AxisValue(x);
axisValueX.setLabel(date);
axisValuesX.add(axisValueX);
}
} while (data.moveToNext());
// Prepare data for chart
Line line = new Line(pointValues).setColor(Color.WHITE).setCubic(false);
List<Line> lines = new ArrayList<>();
lines.add(line);
LineChartData lineChartData = new LineChartData();
lineChartData.setLines(lines);
// Init x-axis
Axis axisX = new Axis(axisValuesX);
axisX.setHasLines(true);
axisX.setMaxLabelChars(4);
lineChartData.setAxisXBottom(axisX);
// Init y-axis
Axis axisY = new Axis();
axisY.setAutoGenerated(true);
axisY.setHasLines(true);
axisY.setMaxLabelChars(4);
lineChartData.setAxisYLeft(axisY);
// Update chart with new data.
mChart.setInteractive(false);
mChart.setLineChartData(lineChartData);
// Show chart
mChart.setVisibility(View.VISIBLE);
mTabContent.setVisibility(View.VISIBLE);
}
示例5: populateMeeting
import lecho.lib.hellocharts.model.Axis; //导入方法依赖的package包/类
public static void populateMeeting(Context context, ColumnChartView chart, @NonNull Cursor cursor) {
List<AxisValue> xAxisValues = new ArrayList<>();
List<Column> columns = new ArrayList<>();
MeetingMemberCursorWrapper cursorWrapper = new MeetingMemberCursorWrapper(cursor);
int maxLabelLength = 0;
while (cursorWrapper.moveToNext()) {
List<SubcolumnValue> subcolumnValues = new ArrayList<>();
Column column = new Column(subcolumnValues);
Long memberId = cursorWrapper.getMemberId();
String memberName = cursorWrapper.getMemberName();
float durationInMinutes = (float) cursorWrapper.getDuration() / 60;
String durationLabel = DateUtils.formatElapsedTime(cursorWrapper.getDuration());
SubcolumnValue subcolumnValue = new SubcolumnValue();
subcolumnValue.setValue(durationInMinutes);
subcolumnValue.setLabel(durationLabel);
int color = ChartUtils.getMemberColor(context, memberId);
subcolumnValue.setColor(color);
subcolumnValues.add(subcolumnValue);
column.setHasLabels(true);
column.setValues(subcolumnValues);
columns.add(column);
AxisValue xAxisValue = new AxisValue(xAxisValues.size());
xAxisValue.setLabel(memberName);
xAxisValues.add(xAxisValue);
if (memberName.length() > maxLabelLength) maxLabelLength = memberName.length();
}
cursor.moveToPosition(-1);
Axis xAxis = new Axis(xAxisValues);
xAxis.setAutoGenerated(false);
//xAxis.setMaxLabelChars(maxLabelLength);
xAxis.setTextColor(ResourcesCompat.getColor(context.getResources(), R.color.chart_text, null));
xAxis.setHasTiltedLabels(true);
ColumnChartData data = new ColumnChartData();
data.setAxisXBottom(xAxis);
data.setColumns(columns);
chart.setInteractive(true);
chart.setColumnChartData(data);
chart.setZoomEnabled(true);
chart.setZoomType(ZoomType.HORIZONTAL);
}