本文整理汇总了Java中org.eazegraph.lib.charts.BarChart类的典型用法代码示例。如果您正苦于以下问题:Java BarChart类的具体用法?Java BarChart怎么用?Java BarChart使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
BarChart类属于org.eazegraph.lib.charts包,在下文中一共展示了BarChart类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: onCreateView
import org.eazegraph.lib.charts.BarChart; //导入依赖的package包/类
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
// Inflate the layout for this fragment
View view = inflater.inflate(R.layout.fragment_bar_chart, container, false);
mBarChart = (BarChart) view.findViewById(R.id.barchart);
mBarChart.setOnBarClickedListener(new IOnBarClickedListener() {
@Override
public void onBarClicked(int _Position) {
Log.d("BarChart", "Position: " + _Position);
}
});
loadData();
return view;
}
开发者ID:blackfizz,项目名称:EazeGraph,代码行数:18,代码来源:BarChartFragment.java
示例2: onCreateView
import org.eazegraph.lib.charts.BarChart; //导入依赖的package包/类
@Override
public View onCreateView(LayoutInflater inflater,
@Nullable ViewGroup container,
@Nullable Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.day25_fragment_bar_chart, container, false);
mBarChart = (BarChart) view.findViewById(R.id.barchart);
initData();
return view;
}
开发者ID:Phonbopit,项目名称:30-android-libraries-in-30-days,代码行数:13,代码来源:BarChartFragment.java
示例3: onCreateView
import org.eazegraph.lib.charts.BarChart; //导入依赖的package包/类
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
View last_month = inflater.inflate(R.layout.last_month, container, false);
//((TextView) last_month.findViewById(R.id.textView)).setText("Same UI as 'TODAY' tab");
mUsageStatsManager = (UsageStatsManager) getActivity().getSystemService(Context.USAGE_STATS_SERVICE);
mInflater = (LayoutInflater) getActivity().getSystemService(Context.LAYOUT_INFLATER_SERVICE);
mPm = getActivity().getPackageManager();
sp = this.getActivity().getSharedPreferences(PREFS_NAME, Context.MODE_PRIVATE);
getSavedApps.clear();
int size = sp.getInt("Status_size", 0);
for (int i = 0; i < size; i++) {
getSavedApps.add(sp.getString("Status_" + i, null));
}
for (int i = 0; i < getSavedApps.size(); i++) {
System.out.println("******Saved Package LiSt: " + getSavedApps.get(i));
}
ListView listView = (ListView) last_month.findViewById(R.id.LastMonthList);
mAdapter = new UsageStatsAdapter();
listView.setAdapter(mAdapter);
mBarChart = (BarChart) last_month.findViewById(R.id.barchart);
for (int i = 0; i < mAdapter.mPackageStats.size(); i++) {
Random rnd = new Random();
//int color = Color.argb(rnd.nextInt(256), rnd.nextInt(256), rnd.nextInt(256), rnd.nextInt(256));
System.out.println("***pack name**" + mAdapter.mPackageStats.get(i).getPackageName());
System.out.println("***label name**" + mAdapter.mAppLabelMap.get(mAdapter.mPackageStats.get(i).getPackageName()));
float duration = (int) mAdapter.mPackageStats.get(i).getTotalTimeInForeground() / 1000;
//mPieChart.addPieSlice(new PieModel(mAdapter.mAppLabelMap.get(mAdapter.mPackageStats.get(i).getPackageName()), duration, Color.rgb(255, rnd.nextInt(), rnd.nextInt())));
mBarChart.addBar(new BarModel(mAdapter.mAppLabelMap.get(mAdapter.mPackageStats.get(i).getPackageName()), duration, Color.rgb(255, rnd.nextInt(), rnd.nextInt())));
System.out.println("***color = " + Color.rgb(255, rnd.nextInt(), rnd.nextInt()));
System.out.println("***duration***" + duration);
}
mBarChart.startAnimation();
return last_month;
}
开发者ID:spate141,项目名称:App-Monitor,代码行数:46,代码来源:LastMonth.java
注:本文中的org.eazegraph.lib.charts.BarChart类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论