本文整理汇总了Java中lecho.lib.hellocharts.model.SubcolumnValue类的典型用法代码示例。如果您正苦于以下问题:Java SubcolumnValue类的具体用法?Java SubcolumnValue怎么用?Java SubcolumnValue使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
SubcolumnValue类属于lecho.lib.hellocharts.model包,在下文中一共展示了SubcolumnValue类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: calculateMaxViewportForStacked
import lecho.lib.hellocharts.model.SubcolumnValue; //导入依赖的package包/类
private void calculateMaxViewportForStacked(ColumnChartData data) {
for (Column column : data.getColumns()) {
float sumPositive = baseValue;
float sumNegative = baseValue;
for (SubcolumnValue columnValue : column.getValues()) {
if (columnValue.getValue() >= baseValue) {
sumPositive += columnValue.getValue();
} else {
sumNegative += columnValue.getValue();
}
}
if (sumPositive > tempMaximumViewport.top) {
tempMaximumViewport.top = sumPositive;
}
if (sumNegative < tempMaximumViewport.bottom) {
tempMaximumViewport.bottom = sumNegative;
}
}
}
示例2: generateDefaultData
import lecho.lib.hellocharts.model.SubcolumnValue; //导入依赖的package包/类
private void generateDefaultData() {
int numSubcolumns = 1;
int numColumns = 50;
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()));
}
columns.add(new Column(values));
}
data = new ColumnChartData(columns);
data.setAxisXBottom(new Axis());
data.setAxisYLeft(new Axis().setHasLines(true));
// prepare preview data, is better to use separate deep copy for preview chart.
// set color to grey to make preview area more visible.
previewData = new ColumnChartData(data);
for (Column column : previewData.getColumns()) {
for (SubcolumnValue value : column.getValues()) {
value.setColor(ChartUtils.DEFAULT_DARKEN_COLOR);
}
}
}
示例3: generateColumnChartData
import lecho.lib.hellocharts.model.SubcolumnValue; //导入依赖的package包/类
private ColumnChartData generateColumnChartData() {
int numSubcolumns = 1;
int numColumns = 12;
// 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()));
}
columns.add(new Column(values));
}
ColumnChartData data = new ColumnChartData(columns);
data.setAxisXBottom(new Axis().setName("Axis X"));
data.setAxisYLeft(new Axis().setName("Axis Y").setHasLines(true));
return data;
}
示例4: generateColumnData
import lecho.lib.hellocharts.model.SubcolumnValue; //导入依赖的package包/类
private ColumnChartData generateColumnData() {
int numSubcolumns = 1;
int numColumns = 12;
// 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() * 50 + 5, ChartUtils.COLOR_GREEN));
}
columns.add(new Column(values));
}
ColumnChartData columnChartData = new ColumnChartData(columns);
return columnChartData;
}
示例5: onValueSelected
import lecho.lib.hellocharts.model.SubcolumnValue; //导入依赖的package包/类
/**
* @param columnIndex starts from the oldest
* @param subcolumnIndex 0 -> fuel, 1-> expense
* @param value
*/
@Override
public void onValueSelected(int columnIndex, int subcolumnIndex, SubcolumnValue value) {
switch (subcolumnIndex) {
case 0:
Toast.makeText(getActivity(), getString(R.string.statistics_expense_price_alert,
BigDecimalFormatter.getCommonFormat().format(value.getValue()) + " " +
vehicle.getCurrencySymbol()), Toast.LENGTH_SHORT).show();
return;
case 1:
Toast.makeText(getActivity(), getString(R.string.statistics_fuel_price_alert,
BigDecimalFormatter.getCommonFormat().format(value.getValue()) + " " +
vehicle.getCurrencySymbol()), Toast.LENGTH_SHORT).show();
return;
default:
throw new RuntimeException("Unknown value selected");
}
}
示例6: calculateMaxViewportForStacked
import lecho.lib.hellocharts.model.SubcolumnValue; //导入依赖的package包/类
private void calculateMaxViewportForStacked(ColumnChartData data) {
for (Column column : data.getColumns()) {
float sumPositive = this.baseValue;
float sumNegative = this.baseValue;
for (SubcolumnValue columnValue : column.getValues()) {
if (columnValue.getValue() >= this.baseValue) {
sumPositive += columnValue.getValue();
} else {
sumNegative += columnValue.getValue();
}
}
if (sumPositive > this.tempMaximumViewport.top) {
this.tempMaximumViewport.top = sumPositive;
}
if (sumNegative < this.tempMaximumViewport.bottom) {
this.tempMaximumViewport.bottom = sumNegative;
}
}
}
示例7: getColumnsData
import lecho.lib.hellocharts.model.SubcolumnValue; //导入依赖的package包/类
private List<Column> getColumnsData(List<DietRecord> records) {
if (records == null || records.size() == 0) {
return null;
}
this.mRecordValues.clear();
List<Column> columnList = new ArrayList();
for (int i = 0; i < records.size(); i++) {
List<SubcolumnValue> values = new ArrayList();
values.add(new SubcolumnValue(((DietRecord) records.get(i)).eating_calory, this
.resources.getColor(R.color.cq)));
values.add(new SubcolumnValue(((DietRecord) records.get(i)).activity_calory, this
.resources.getColor(R.color.i0)));
this.mRecordValues.add(Float.valueOf(((DietRecord) records.get(i)).eating_calory));
this.mRecordValues.add(Float.valueOf(((DietRecord) records.get(i)).activity_calory));
Column column = new Column(values);
column.setHasLabels(true);
columnList.add(column);
}
return columnList;
}
示例8: getColumnsData
import lecho.lib.hellocharts.model.SubcolumnValue; //导入依赖的package包/类
private List<Column> getColumnsData(List<StepModel> steps) {
if (steps == null || steps.size() == 0) {
return null;
}
List<Column> columns = new ArrayList();
for (int i = 0; i < steps.size(); i++) {
StepModel step = (StepModel) steps.get(i);
List<SubcolumnValue> values = new ArrayList();
values.add(new SubcolumnValue((float) step.step, ContextCompat.getColor(this.context,
R.color.jv)));
Column column = new Column(values);
column.setHasLabels(true);
columns.add(column);
}
return columns;
}
示例9: onValueSelected
import lecho.lib.hellocharts.model.SubcolumnValue; //导入依赖的package包/类
@Override
public void onValueSelected(int columnIndex, int subcolumnIndex, SubcolumnValue value) {
// 获取点击的条目数值
String vaule = value.toString();
int end = vaule.length() - 3;
// 截取所需字符串
String subV = vaule.substring(19, end);
switch (columnIndex) {
case 0:
ToastUtli.show(getContext(), "总共" + subV + "人");
break;
case 1:
ToastUtli.show(getContext(), "已报到" + subV + "人");
break;
case 2:
ToastUtli.show(getContext(), "未报到" + subV + "人");
break;
}
}
示例10: onValueSelected
import lecho.lib.hellocharts.model.SubcolumnValue; //导入依赖的package包/类
@Override
public void onValueSelected(int columnIndex, int subcolumnIndex, SubcolumnValue value) {
// 获取点击的条目数值
String vaule = value.toString();
int end = vaule.length()-3;
// 截取所需字符串
String subV = vaule.substring(19,end);
switch (columnIndex){
case 0:
ToastUtli.show(getContext(),"总共"+subV+"人");
break;
case 1:
ToastUtli.show(getContext(),"已报到"+subV+"人");
break;
case 2:
ToastUtli.show(getContext(),"未报到"+subV+"人");
break;
}
}
示例11: onValueSelected
import lecho.lib.hellocharts.model.SubcolumnValue; //导入依赖的package包/类
@Override
public void onValueSelected(int columnIndex, int subcolumnIndex, SubcolumnValue value) {
// 获取点击的条目数值
String vaule = value.toString();
int end = vaule.length() - 3;
// 截取所需字符串
String subV = vaule.substring(19, end);
switch (subcolumnIndex) {
case 0:
ToastUtli.show(getContext(), "未报到" + subV + "人");
break;
case 1:
ToastUtli.show(getContext(), "已报到" + subV + "人");
break;
}
}
示例12: onValueSelected
import lecho.lib.hellocharts.model.SubcolumnValue; //导入依赖的package包/类
@Override
public void onValueSelected(int columnIndex, int subcolumnIndex, SubcolumnValue value) {
// 获取点击的条目数值
String vaule = value.toString();
int end = vaule.length() - 3;
// 截取所需字符串
String subV = vaule.substring(19, end);
switch (columnIndex) {
case 0:
ToastUtli.show(getContext(), "总共" + subV + "人");
break;
case 1:
ToastUtli.show(getContext(), "未交费" + subV + "人");
break;
case 2:
ToastUtli.show(getContext(), "已缴费" + subV + "人");
break;
case 3:
ToastUtli.show(getContext(), "贷款缴费" + subV + "人");
break;
case 4:
ToastUtli.show(getContext(), "缓缴费" + subV + "人");
break;
}
}
示例13: setChartValues
import lecho.lib.hellocharts.model.SubcolumnValue; //导入依赖的package包/类
@Override
protected void setChartValues(List<Measurement> measurements, HRVParameterEnum hrvValueType) {
Calendar calendar = GregorianCalendar.getInstance();
calendar.setFirstDayOfWeek(Calendar.MONDAY);
for (Measurement measurement : measurements) {
calendar.setTime(measurement.getTime());
//Minus 2 because get always returns 1 for sunday.
int day = calendar.get(Calendar.DAY_OF_WEEK) - 2;
//If day == sunday, make it the last day of the week.
if (day == -1) {
day = 6;
}
double value = getValue(measurement, hrvValueType);
if (value < 0) {
continue;
}
columns[day].getValues().add(
new SubcolumnValue((float) value, getColor()));
configColumnLabels(day);
}
}
示例14: setChartValues
import lecho.lib.hellocharts.model.SubcolumnValue; //导入依赖的package包/类
@Override
protected void setChartValues(List<Measurement> measurements, HRVParameterEnum hrvValueType) {
Calendar calendar = GregorianCalendar.getInstance();
for (Measurement measurement : measurements) {
calendar.setTime(measurement.getTime());
int hour = calendar.get(Calendar.HOUR_OF_DAY);
int minutes = calendar.get(Calendar.MINUTE) / 15;
double value = getValue(measurement, hrvValueType);
if (value < 0) {
continue;
}
columns[hour].getValues().set(minutes,
new SubcolumnValue((float) value, getColor()));
configColumnLabels(hour);
}
}
示例15: setChartValues
import lecho.lib.hellocharts.model.SubcolumnValue; //导入依赖的package包/类
@Override
protected void setChartValues(List<Measurement> measurements, HRVParameterEnum hrvValueType) {
Calendar calendar = GregorianCalendar.getInstance();
calendar.setFirstDayOfWeek(Calendar.MONDAY);
for (Measurement measurement : measurements) {
calendar.setTime(measurement.getTime());
int day = calendar.get(Calendar.DAY_OF_MONTH) - 1;
double value = getValue(measurement, hrvValueType);
if (value < 0) {
continue;
}
columns[day].getValues().add(
new SubcolumnValue((float) value, getColor()));
configColumnLabels(day);
}
}