本文整理汇总了Java中com.echo.holographlibrary.Bar类的典型用法代码示例。如果您正苦于以下问题:Java Bar类的具体用法?Java Bar怎么用?Java Bar使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Bar类属于com.echo.holographlibrary包,在下文中一共展示了Bar类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: shouldRenderTheGraphWithRightPoints
import com.echo.holographlibrary.Bar; //导入依赖的package包/类
@Test
public void shouldRenderTheGraphWithRightPoints() throws Exception {
Expense food = new Expense(100l, "Food", "01-10-2015");
when(database.getExpensesForCurrentMonthGroupByCategory()).thenReturn(asList(food));
CurrentMonthExpensePresenter presenter = new CurrentMonthExpensePresenter(view, database);
ArgumentCaptor<List> pointsCaptor = ArgumentCaptor.forClass(List.class);
presenter.plotGraph();
verify(view).getGraphColor();
verify(view).displayGraph(pointsCaptor.capture());
List points = pointsCaptor.getValue();
assertThat(points.size(), is(1));
assertThat(((Bar)points.get(0)).getName(), is(food.getType()));
assertThat(((Bar)points.get(0)).getValue(), is(food.getAmount().floatValue()));
}
开发者ID:ajitsing,项目名称:ExpenseManager,代码行数:18,代码来源:CurrentMonthExpensePresenterTest.java
示例2: onPostExecute
import com.echo.holographlibrary.Bar; //导入依赖的package包/类
@Override
protected void onPostExecute(Statistics[] stats) {
if (stats != null) {
ArrayList<Bar> bars = new ArrayList<>(stats.length);
for (Statistics stat : stats) {
Bar b = new Bar();
b.setName(stat.getName());
b.setValue(stat.getAverageThroughputPerSecond());
bars.add(b);
}
this.bars = bars;
if (listener != null) {
listener.onTaskResult(bars);
}
}
isStarted = false;
}
开发者ID:evant,项目名称:parsnip,代码行数:18,代码来源:StatisticsTask.java
示例3: initBarGraph
import com.echo.holographlibrary.Bar; //导入依赖的package包/类
/**
* 棒グラフを初期化する。
*/
private void initBarGraph() {
ArrayList<Bar> points = new ArrayList<Bar>();
points.add(createPointForBar("#99CC00", "X社", 11));
points.add(createPointForBar("#990000", "Y社", 7));
BarGraph barGraph = (BarGraph) findViewById(R.id.bargraph);
barGraph.setBars(points);
barGraph.setOnBarClickedListener(new OnBarClickedListener() {
@Override
public void onClick(int index) {
}
});
}
开发者ID:android-opensource-library-56,项目名称:android-opensource-library-56,代码行数:19,代码来源:HoloGraphLibrarySampleActivity.java
示例4: plotGraph
import com.echo.holographlibrary.Bar; //导入依赖的package包/类
public void plotGraph() {
List<Bar> points = new ArrayList<Bar>();
for (Expense expense : expenseCollection.withoutMoneyTransfer()) {
Bar bar = new Bar();
bar.setColor(view.getGraphColor());
bar.setName(expense.getType());
bar.setValue(expense.getAmount());
points.add(bar);
}
view.displayGraph(points);
}
开发者ID:ajitsing,项目名称:ExpenseManager,代码行数:14,代码来源:CurrentMonthExpensePresenter.java
示例5: drawHistory
import com.echo.holographlibrary.Bar; //导入依赖的package包/类
private void drawHistory() {
final ArrayList<Bar> points = new ArrayList<Bar>();
for (DayHistory dh : history.getLastWeek()) {
Bar d = new Bar();
d.setColor(getActivity().getResources().getColor(R.color.graph_history));
SimpleDateFormat formatter=new SimpleDateFormat("E");
if(dh != null) {
d.setName(formatter.format(dh.getCalendar().getTime()));
d.setValue(dh.getTotalSteps());
if(dayOfWeek == dh.getCalendar().get(Calendar.DAY_OF_WEEK)) {
d.setColor(getActivity().getResources().getColor(R.color.graph_history_selected));
} else {
d.setSelectedColor(getActivity().getResources().getColor(R.color.graph_history_selected));
}
} else {
d.setName("...");
d.setValue(0);
}
points.add(d);
}
final BarGraph g = (BarGraph)getActivity().findViewById(R.id.graph_history);
g.setOnBarClickedListener(new BarGraph.OnBarClickedListener() {
@Override
public void onClick(int index) {
Bar c = points.get(index);
mListener.setCurrentDay(batteryLevel, history, weekday2int(c.getName()));
}
});
g.setBars(points);
}
开发者ID:dgomes,项目名称:openvidonn,代码行数:38,代码来源:CurrentFragment.java
示例6: createPointForBar
import com.echo.holographlibrary.Bar; //导入依赖的package包/类
private Bar createPointForBar(String colorCode, String name, int value) {
Bar bar = new Bar();
bar.setColor(Color.parseColor(colorCode));
bar.setName(name);
bar.setValue(value);
return bar;
}
开发者ID:android-opensource-library-56,项目名称:android-opensource-library-56,代码行数:8,代码来源:HoloGraphLibrarySampleActivity.java
示例7: displayGraph
import com.echo.holographlibrary.Bar; //导入依赖的package包/类
@Override
public void displayGraph(List<Bar> points) {
BarGraph graph = (BarGraph)getActivity().findViewById(R.id.graph);
graph.setBars((ArrayList<Bar>) points);
}
开发者ID:ajitsing,项目名称:ExpenseManager,代码行数:6,代码来源:CurrentMonthExpenseFragment.java
示例8: onTaskResult
import com.echo.holographlibrary.Bar; //导入依赖的package包/类
@Override
public void onTaskResult(ArrayList<Bar> bars) {
progressBar.setProgress(0);
startBenchmarks.setEnabled(true);
graph.setBars(bars);
}
开发者ID:evant,项目名称:parsnip,代码行数:7,代码来源:MainActivity.java
示例9: displayGraph
import com.echo.holographlibrary.Bar; //导入依赖的package包/类
void displayGraph(List<Bar> points);
开发者ID:ajitsing,项目名称:ExpenseManager,代码行数:2,代码来源:CurrentMonthExpenseView.java
示例10: onTaskResult
import com.echo.holographlibrary.Bar; //导入依赖的package包/类
void onTaskResult(ArrayList<Bar> bars);
开发者ID:evant,项目名称:parsnip,代码行数:2,代码来源:StatisticsTask.java
注:本文中的com.echo.holographlibrary.Bar类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论