本文整理汇总了Java中lecho.lib.hellocharts.model.Axis.setName方法的典型用法代码示例。如果您正苦于以下问题:Java Axis.setName方法的具体用法?Java Axis.setName怎么用?Java Axis.setName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类lecho.lib.hellocharts.model.Axis
的用法示例。
在下文中一共展示了Axis.setName方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: generateData
import lecho.lib.hellocharts.model.Axis; //导入方法依赖的package包/类
private void generateData() {
// Chart looks the best when line data and column data have similar maximum viewports.
data = new ComboLineColumnChartData(generateColumnData(), generateLineData());
if (hasAxes) {
Axis axisX = new Axis();
Axis axisY = new Axis().setHasLines(true);
if (hasAxesNames) {
axisX.setName("Axis X");
axisY.setName("Axis Y");
}
data.setAxisXBottom(axisX);
data.setAxisYLeft(axisY);
} else {
data.setAxisXBottom(null);
data.setAxisYLeft(null);
}
chart.setComboLineColumnChartData(data);
}
示例2: generateDefaultData
import lecho.lib.hellocharts.model.Axis; //导入方法依赖的package包/类
private void generateDefaultData() {
int numSubcolumns = 1;
int numColumns = 8;
// Column can have many subcolumns, here by default I use 1 subcolumn in each of 8 columns.
List<Column> columns = new ArrayList<Column>();
List<SubcolumnValue> values;
for (int i = 0; i < numColumns; ++i) {
values = new ArrayList<SubcolumnValue>();
for (int j = 0; j < numSubcolumns; ++j) {
values.add(new SubcolumnValue((float) Math.random() * 50f + 5, ChartUtils.pickColor()));
}
Column column = new Column(values);
column.setHasLabels(hasLabels);
column.setHasLabelsOnlyForSelected(hasLabelForSelected);
columns.add(column);
}
data = new ColumnChartData(columns);
if (hasAxes) {
Axis axisX = new Axis();
Axis axisY = new Axis().setHasLines(true);
if (hasAxesNames) {
axisX.setName("Axis X");
axisY.setName("Axis Y");
}
data.setAxisXBottom(axisX);
data.setAxisYLeft(axisY);
} else {
data.setAxisXBottom(null);
data.setAxisYLeft(null);
}
chart.setColumnChartData(data);
}
示例3: generateSubcolumnsData
import lecho.lib.hellocharts.model.Axis; //导入方法依赖的package包/类
/**
* Generates columns with subcolumns, columns have larger separation than subcolumns.
*/
private void generateSubcolumnsData() {
int numSubcolumns = 4;
int numColumns = 4;
// Column can have many subcolumns, here I use 4 subcolumn in each of 8 columns.
List<Column> columns = new ArrayList<Column>();
List<SubcolumnValue> values;
for (int i = 0; i < numColumns; ++i) {
values = new ArrayList<SubcolumnValue>();
for (int j = 0; j < numSubcolumns; ++j) {
values.add(new SubcolumnValue((float) Math.random() * 50f + 5, ChartUtils.pickColor()));
}
Column column = new Column(values);
column.setHasLabels(hasLabels);
column.setHasLabelsOnlyForSelected(hasLabelForSelected);
columns.add(column);
}
data = new ColumnChartData(columns);
if (hasAxes) {
Axis axisX = new Axis();
Axis axisY = new Axis().setHasLines(true);
if (hasAxesNames) {
axisX.setName("Axis X");
axisY.setName("Axis Y");
}
data.setAxisXBottom(axisX);
data.setAxisYLeft(axisY);
} else {
data.setAxisXBottom(null);
data.setAxisYLeft(null);
}
chart.setColumnChartData(data);
}
示例4: generateNegativeSubcolumnsData
import lecho.lib.hellocharts.model.Axis; //导入方法依赖的package包/类
private void generateNegativeSubcolumnsData() {
int numSubcolumns = 4;
int numColumns = 4;
List<Column> columns = new ArrayList<Column>();
List<SubcolumnValue> values;
for (int i = 0; i < numColumns; ++i) {
values = new ArrayList<SubcolumnValue>();
for (int j = 0; j < numSubcolumns; ++j) {
int sign = getSign();
values.add(new SubcolumnValue((float) Math.random() * 50f * sign + 5 * sign, ChartUtils.pickColor
()));
}
Column column = new Column(values);
column.setHasLabels(hasLabels);
column.setHasLabelsOnlyForSelected(hasLabelForSelected);
columns.add(column);
}
data = new ColumnChartData(columns);
if (hasAxes) {
Axis axisX = new Axis();
Axis axisY = new Axis().setHasLines(true);
if (hasAxesNames) {
axisX.setName("Axis X");
axisY.setName("Axis Y");
}
data.setAxisXBottom(axisX);
data.setAxisYLeft(axisY);
} else {
data.setAxisXBottom(null);
data.setAxisYLeft(null);
}
chart.setColumnChartData(data);
}
示例5: generateData
import lecho.lib.hellocharts.model.Axis; //导入方法依赖的package包/类
private void generateData() {
List<BubbleValue> values = new ArrayList<BubbleValue>();
for (int i = 0; i < BUBBLES_NUM; ++i) {
BubbleValue value = new BubbleValue(i, (float) Math.random() * 100, (float) Math.random() * 1000);
value.setColor(ChartUtils.pickColor());
value.setShape(shape);
values.add(value);
}
data = new BubbleChartData(values);
data.setHasLabels(hasLabels);
data.setHasLabelsOnlyForSelected(hasLabelForSelected);
if (hasAxes) {
Axis axisX = new Axis();
Axis axisY = new Axis().setHasLines(true);
if (hasAxesNames) {
axisX.setName("Axis X");
axisY.setName("Axis Y");
}
data.setAxisXBottom(axisX);
data.setAxisYLeft(axisY);
} else {
data.setAxisXBottom(null);
data.setAxisYLeft(null);
}
chart.setBubbleChartData(data);
}
示例6: setBubbleDatas
import lecho.lib.hellocharts.model.Axis; //导入方法依赖的package包/类
private void setBubbleDatas() {
List<BubbleValue> values = new ArrayList<>();
//设置每个气泡的数据、颜色、形状
for (int i = 0; i < BUBBLES_NUM; i++) {
BubbleValue value = new BubbleValue(i, (float) Math.random() * 100, (float) Math.random() * 1000);
value.setColor(ChartUtils.pickColor());
value.setShape(bubbleShape);
value.setLabel(labelStrs[i]);
values.add(value);
}
//设置其他属性
mBubbleData = new BubbleChartData(values);
mBubbleData.setHasLabels(isHasLabels);
mBubbleData.setHasLabelsOnlyForSelected(isBubblesHasSelected);
//设置坐标轴相关属性
if (isHasAxes) {
Axis axisX = new Axis();
Axis axisY = new Axis().setHasLines(true);
if (isHasAxesName) {
axisX.setName("Axis X");
axisY.setName("Axis Y");
}
mBubbleData.setAxisXBottom(axisX);
mBubbleData.setAxisYLeft(axisY);
} else {
mBubbleData.setAxisXBottom(null);
mBubbleData.setAxisYLeft(null);
}
mBubbleView.setBubbleChartData(mBubbleData);
}
示例7: setChartAxis
import lecho.lib.hellocharts.model.Axis; //导入方法依赖的package包/类
private void setChartAxis(ColumnChartData data) {
Axis axisX = new Axis();
Axis axisY = new Axis().setHasLines(true);
axisX.setName("s");
axisY.setName("s");
data.setAxisXBottom(axisX);
data.setAxisYLeft(axisY);
}
示例8: setAxis
import lecho.lib.hellocharts.model.Axis; //导入方法依赖的package包/类
/**
* Sets the properties of the X and Y axis of the chart.
*/
private void setAxis(ColumnChartView mChart, HRVParameterEnum hrvValue) {
ColumnChartData data = new ColumnChartData(new ArrayList<>(Arrays.asList(columns)));
Axis axisX = new Axis();
Axis axisY = new Axis().setHasLines(true);
axisX.setName(getXAxisLabel());
axisX.setValues(getXAxisValues());
axisY.setName(getUnit(hrvValue));
data.setAxisXBottom(axisX);
data.setAxisYLeft(axisY);
mChart.setZoomEnabled(false);
mChart.setColumnChartData(data);
}
示例9: getYAxis
import lecho.lib.hellocharts.model.Axis; //导入方法依赖的package包/类
@Override
public Axis getYAxis() {
Axis axis = new Axis();
axis.setName("m/s*s");
axis.setHasLines(true);
return axis;
}
示例10: getYAxis
import lecho.lib.hellocharts.model.Axis; //导入方法依赖的package包/类
@Override
public Axis getYAxis() {
Axis axis = new Axis();
axis.setName("G's");
axis.setHasLines(true);
return axis;
}
示例11: getYAxis
import lecho.lib.hellocharts.model.Axis; //导入方法依赖的package包/类
@Override
public Axis getYAxis() {
Axis axis = new Axis();
axis.setName("Meters");
axis.setHasLines(true);
return axis;
}
示例12: setDistanceAxis
import lecho.lib.hellocharts.model.Axis; //导入方法依赖的package包/类
private void setDistanceAxis(LineChartData data) {
Axis distAxis = new Axis();
distAxis.setName(getString(R.string.track_statistics_distance));
distAxis.setTextColor(getResources().getColor(R.color.blue_dark_cario));
distAxis.setMaxLabelChars(5);
distAxis.setFormatter(new SimpleAxisValueFormatter()
.setAppendedText("km".toCharArray()));
distAxis.setHasLines(true);
distAxis.setHasTiltedLabels(true);
distAxis.setTextSize(10);
distAxis.setHasSeparationLine(false);
data.setAxisXBottom(distAxis);
}
示例13: setYAxis
import lecho.lib.hellocharts.model.Axis; //导入方法依赖的package包/类
private void setYAxis(Measurement.PropertyKey key, LineChartData data) {
Axis yAxis = new Axis();
yAxis.setName(getString(key.getStringResource()));
yAxis.setTextColor(getResources().getColor(R.color.blue_dark_cario));
yAxis.setMaxLabelChars(3);
yAxis.setHasLines(true);
yAxis.setTextSize(10);
yAxis.setFormatter(new SimpleAxisValueFormatter());
yAxis.setInside(false);
yAxis.setHasSeparationLine(false);
data.setAxisYLeft(yAxis);
}
示例14: generateStackedData
import lecho.lib.hellocharts.model.Axis; //导入方法依赖的package包/类
/**
* Generates columns with stacked subcolumns.
*/
private void generateStackedData() {
int numSubcolumns = 4;
int numColumns = 8;
// Column can have many stacked subcolumns, here I use 4 stacke subcolumn in each of 4 columns.
List<Column> columns = new ArrayList<Column>();
List<SubcolumnValue> values;
for (int i = 0; i < numColumns; ++i) {
values = new ArrayList<SubcolumnValue>();
for (int j = 0; j < numSubcolumns; ++j) {
values.add(new SubcolumnValue((float) Math.random() * 20f + 5, ChartUtils.pickColor()));
}
Column column = new Column(values);
column.setHasLabels(hasLabels);
column.setHasLabelsOnlyForSelected(hasLabelForSelected);
columns.add(column);
}
data = new ColumnChartData(columns);
// Set stacked flag.
data.setStacked(true);
if (hasAxes) {
Axis axisX = new Axis();
Axis axisY = new Axis().setHasLines(true);
if (hasAxesNames) {
axisX.setName("Axis X");
axisY.setName("Axis Y");
}
data.setAxisXBottom(axisX);
data.setAxisYLeft(axisY);
} else {
data.setAxisXBottom(null);
data.setAxisYLeft(null);
}
chart.setColumnChartData(data);
}
示例15: generateNegativeStackedData
import lecho.lib.hellocharts.model.Axis; //导入方法依赖的package包/类
private void generateNegativeStackedData() {
int numSubcolumns = 4;
int numColumns = 8;
// Column can have many stacked subcolumns, here I use 4 stacke subcolumn in each of 4 columns.
List<Column> columns = new ArrayList<Column>();
List<SubcolumnValue> values;
for (int i = 0; i < numColumns; ++i) {
values = new ArrayList<SubcolumnValue>();
for (int j = 0; j < numSubcolumns; ++j) {
int sign = getSign();
values.add(new SubcolumnValue((float) Math.random() * 20f * sign + 5 * sign, ChartUtils.pickColor()));
}
Column column = new Column(values);
column.setHasLabels(hasLabels);
column.setHasLabelsOnlyForSelected(hasLabelForSelected);
columns.add(column);
}
data = new ColumnChartData(columns);
// Set stacked flag.
data.setStacked(true);
if (hasAxes) {
Axis axisX = new Axis();
Axis axisY = new Axis().setHasLines(true);
if (hasAxesNames) {
axisX.setName("Axis X");
axisY.setName("Axis Y");
}
data.setAxisXBottom(axisX);
data.setAxisYLeft(axisY);
} else {
data.setAxisXBottom(null);
data.setAxisYLeft(null);
}
chart.setColumnChartData(data);
}