• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java PieChart类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中org.eazegraph.lib.charts.PieChart的典型用法代码示例。如果您正苦于以下问题:Java PieChart类的具体用法?Java PieChart怎么用?Java PieChart使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



PieChart类属于org.eazegraph.lib.charts包,在下文中一共展示了PieChart类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: onCreateView

import org.eazegraph.lib.charts.PieChart; //导入依赖的package包/类
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
                         Bundle savedInstanceState) {
    // Inflate the layout for this fragment
    final View v = inflater.inflate(R.layout.fragment_step_status, container, false);

    //int stepsTaken = 15000;
    //int goalSteps = 20000;
    int numPotatoesBurned = calculatePotatoesBurned(stepsTakenToday);
    //handleGetStepsButton();
    mPieChart = (PieChart) v.findViewById(R.id.graph);
    stepsView = (TextView) v.findViewById(R.id.steps);
    totalPotatoesView = (TextView) v.findViewById(R.id.potatoes);
    Log.d("Steps taken today are: ", "" + stepsTakenToday);
    stepsView.setText(Integer.toString(stepsTakenToday));
    totalPotatoesView.setText(numPotatoesBurned == 1 ? numPotatoesBurned + " potato"
            : numPotatoesBurned + " potatoes");

    mPieChart.clearChart();
    sliceCurrent = new PieModel("", stepsTakenToday, Color.parseColor("#F38630"));
    mPieChart.addPieSlice(sliceCurrent);
    sliceGoal = new PieModel("", getGoalSteps() - stepsTakenToday, Color.parseColor("#E0E4CC"));
    mPieChart.addPieSlice(sliceGoal);

    mPieChart.startAnimation();

    ((TextView) v.findViewById(R.id.unit)).setText(getString(R.string.steps));

    return v;

}
 
开发者ID:parthsatra,项目名称:WalkPotato,代码行数:32,代码来源:StepStatusFragment.java


示例2: onCreateView

import org.eazegraph.lib.charts.PieChart; //导入依赖的package包/类
@Override
public View onCreateView(LayoutInflater inflater,
                         @Nullable ViewGroup container,
                         @Nullable Bundle savedInstanceState) {

    View view = inflater.inflate(R.layout.day25_fragment_pie_chart, container, false);
    mPieChart = (PieChart) view.findViewById(R.id.piechart);
    initData();

    return view;
}
 
开发者ID:Phonbopit,项目名称:30-android-libraries-in-30-days,代码行数:12,代码来源:PieChartFragment.java


示例3: onCreateView

import org.eazegraph.lib.charts.PieChart; //导入依赖的package包/类
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    final View v = inflater.inflate(R.layout.fragment_overview, null);
    stepsView = (TextView) v.findViewById(R.id.steps);
    totalView = (TextView) v.findViewById(R.id.total);
    averageView = (TextView) v.findViewById(R.id.average);

    pg = (PieChart) v.findViewById(R.id.graph);

    // slice for the steps taken today
    sliceCurrent = new PieModel("", 0, Color.parseColor("#99CC00"));
    pg.addPieSlice(sliceCurrent);

    // slice for the "missing" steps until reaching the goal
    sliceGoal = new PieModel("", Fragment_Settings.DEFAULT_GOAL, Color.parseColor("#CC0000"));
    pg.addPieSlice(sliceGoal);

    pg.setOnClickListener(new OnClickListener() {
        @Override
        public void onClick(final View view) {
            showSteps = !showSteps;
            stepsDistanceChanged();
        }
    });

    pg.setDrawValueInPie(false);
    pg.setUsePieRotation(true);
    pg.startAnimation();
    return v;
}
 
开发者ID:luinvacc,项目名称:pedometer,代码行数:31,代码来源:Fragment_Overview.java


示例4: onCreateView

import org.eazegraph.lib.charts.PieChart; //导入依赖的package包/类
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
                         Bundle savedInstanceState) {
    // Inflate the layout for this fragment
    View view = inflater.inflate(R.layout.fragment_pie_chart, container, false);
    mPieChart = (PieChart) view.findViewById(R.id.piechart);
    loadData();
    return view;
}
 
开发者ID:blackfizz,项目名称:EazeGraph,代码行数:10,代码来源:PieChartFragment.java


示例5: onCreateView

import org.eazegraph.lib.charts.PieChart; //导入依赖的package包/类
@TargetApi(Build.VERSION_CODES.LOLLIPOP)
    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {

        View today = inflater.inflate(R.layout.today, container, false);

        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) today.findViewById(R.id.TodayList);
        mAdapter = new UsageStatsAdapter();
        listView.setAdapter(mAdapter);

        Random rand = new Random();

        mPieChart = (PieChart) today.findViewById(R.id.piechart);
        mPieChart.startAnimation();

        System.out.println("***mAdapter.mPackageStats.size()***" + mAdapter.mPackageStats.size());

        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()));


            int duration = (int) mAdapter.mPackageStats.get(i).getTotalTimeInForeground() / 1000;

//            String hms = String.format("%02d:%02d:%02d",
//                    TimeUnit.MILLISECONDS.toHours(duration),
//                    TimeUnit.MILLISECONDS.toMinutes(duration) -
//                            TimeUnit.HOURS.toMinutes(TimeUnit.MILLISECONDS.toHours(duration)),
//                    TimeUnit.MILLISECONDS.toSeconds(duration) -
//                            TimeUnit.MINUTES.toSeconds(TimeUnit.MILLISECONDS.toMinutes(duration)));
//            float hmsINT = Float.parseFloat(hms);
//            System.out.println("$"+hmsINT);
            mPieChart.addPieSlice(new PieModel(mAdapter.mAppLabelMap.get(mAdapter.mPackageStats.get(i).getPackageName()), duration, Color.rgb(255, rnd.nextInt(), rnd.nextInt())));

            this.mPieChart.setOnFocusChangeListener(new View.OnFocusChangeListener() {
                @Override
                public void onFocusChange(View view, boolean b) {
                    System.out.println("FOCUS CHANGED");
                }
            });

            System.out.println("***color = " + Color.rgb(255, rnd.nextInt(), rnd.nextInt()));
            System.out.println("***duration***" + duration);
        }

        //Starting service on Page Load


        return today;
    }
 
开发者ID:spate141,项目名称:App-Monitor,代码行数:67,代码来源:Today.java


示例6: onCreateView

import org.eazegraph.lib.charts.PieChart; //导入依赖的package包/类
@TargetApi(Build.VERSION_CODES.LOLLIPOP)
    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {

        View all = inflater.inflate(R.layout.sorting, 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();

        ListView listView = (ListView) all.findViewById(R.id.LastMonthList);
        mAdapter = new UsageStatsAdapter();
        listView.setAdapter(mAdapter);

//        BarChart mBarChart = (BarChart) last_month.findViewById(R.id.barchart);
//
//        mBarChart.addBar(new BarModel("1", 2.3f, 0xFF123456));
//        mBarChart.addBar(new BarModel("2",2.f,  0xFF343456));
//        mBarChart.addBar(new BarModel("3",3.3f, 0xFF563456));
//        mBarChart.addBar(new BarModel("4",1.1f, 0xFF873F56));
//        mBarChart.addBar(new BarModel("5",2.7f, 0xFF56B7F1));
//        mBarChart.addBar(new BarModel("6",2.f,  0xFF343456));
//        mBarChart.addBar(new BarModel("7",0.4f, 0xFF1FF4AC));
//        mBarChart.addBar(new BarModel("8",4.f,  0xFF1BA4E6));
//
//        mBarChart.startAnimation();
        mPieChart = (PieChart) all.findViewById(R.id.piechart);
        mPieChart.startAnimation();
        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()));


            int duration = (int) mAdapter.mPackageStats.get(i).getTotalTimeInForeground() / 1000;

//            String hms = String.format("%02d:%02d:%02d",
//                    TimeUnit.MILLISECONDS.toHours(duration),
//                    TimeUnit.MILLISECONDS.toMinutes(duration) -
//                            TimeUnit.HOURS.toMinutes(TimeUnit.MILLISECONDS.toHours(duration)),
//                    TimeUnit.MILLISECONDS.toSeconds(duration) -
//                            TimeUnit.MINUTES.toSeconds(TimeUnit.MILLISECONDS.toMinutes(duration)));
//            float hmsINT = Float.parseFloat(hms);
//            System.out.println("$"+hmsINT);
            mPieChart.addPieSlice(new PieModel(mAdapter.mAppLabelMap.get(mAdapter.mPackageStats.get(i).getPackageName()), duration, Color.rgb(255, rnd.nextInt(), rnd.nextInt())));

            this.mPieChart.setOnFocusChangeListener(new View.OnFocusChangeListener() {
                @Override
                public void onFocusChange(View view, boolean b) {
                    System.out.println("FOCUS CHANGED");
                }
            });

            System.out.println("***color = " + Color.rgb(255, rnd.nextInt(), rnd.nextInt()));
            System.out.println("***duration***" + duration);
        }

        return all;

    }
 
开发者ID:spate141,项目名称:App-Monitor,代码行数:62,代码来源:Sorting.java



注:本文中的org.eazegraph.lib.charts.PieChart类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java IGenericClient类代码示例发布时间:2022-05-23
下一篇:
Java SMSLog类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap