当前位置: 首页>>代码示例>>Java>>正文


Java PieChartView.setOnValueTouchListener方法代码示例

本文整理汇总了Java中lecho.lib.hellocharts.view.PieChartView.setOnValueTouchListener方法的典型用法代码示例。如果您正苦于以下问题:Java PieChartView.setOnValueTouchListener方法的具体用法?Java PieChartView.setOnValueTouchListener怎么用?Java PieChartView.setOnValueTouchListener使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在lecho.lib.hellocharts.view.PieChartView的用法示例。


在下文中一共展示了PieChartView.setOnValueTouchListener方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: onCreateView

import lecho.lib.hellocharts.view.PieChartView; //导入方法依赖的package包/类
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    setHasOptionsMenu(true);
    View rootView = inflater.inflate(R.layout.fragment_pie_chart, container, false);
    chart = (PieChartView) rootView.findViewById(R.id.chart);
    chart.setOnValueTouchListener(new PieChartOnValueSelectListener() {
        @Override
        public void onValueSelected(int arcIndex, SliceValue value) {
            Toast.makeText(getActivity(), String.valueOf(value.getLabelAsChars()), Toast.LENGTH_SHORT).show();
        }

        @Override
        public void onValueDeselected() {

        }
    });

    toggleLabelForSelected();
    return rootView;
}
 
开发者ID:shenyanf,项目名称:AccountBook,代码行数:21,代码来源:PieChartActivity.java

示例2: initPieChart

import lecho.lib.hellocharts.view.PieChartView; //导入方法依赖的package包/类
private void initPieChart(final PieChartView pieChart) {
    initBaseChart(pieChart);

    pieChart.setChartRotationEnabled(false);
    pieChart.setChartRotation(180, false);

    pieChart.setOnValueTouchListener(new PieChartOnValueSelectListener() {
        @Override
        public void onValueSelected(int arcIndex, SliceValue value) {
            SliceValue slice = pieChart.getPieChartData().getValues().get(arcIndex);
            if (slice instanceof EctsSliceValue) {
                pieChart.getPieChartData().setCenterText1(AppUtils.format(getContext(), "%.2f ECTS", ((EctsSliceValue) slice).getEcts()));
                Grade grade = ((EctsSliceValue) slice).getGrade();
                if (grade != null) {
                    pieChart.getPieChartData().setCenterText2(getContext().getString(grade.getStringResID()));
                }
            }
        }

        @Override
        public void onValueDeselected() {
            pieChart.getPieChartData().setCenterText1(null);
            pieChart.getPieChartData().setCenterText2(null);
        }
    });
}
 
开发者ID:marunjar,项目名称:anewjkuapp,代码行数:27,代码来源:StatCardAdapter.java

示例3: onCreateView

import lecho.lib.hellocharts.view.PieChartView; //导入方法依赖的package包/类
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    setHasOptionsMenu(true);
    View rootView = inflater.inflate(R.layout.fragment_pie_chart, container, false);

    chart = (PieChartView) rootView.findViewById(R.id.chart);
    chart.setOnValueTouchListener(new ValueTouchListener());

    generateData();

    return rootView;
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:13,代码来源:PieChartActivity.java

示例4: onActivityCreated

import lecho.lib.hellocharts.view.PieChartView; //导入方法依赖的package包/类
@Override
public void onActivityCreated(Bundle savedInstanceState){
    super.onActivityCreated(savedInstanceState);

    mPieChartView=(PieChartView)view.findViewById(R.id.disease_piechart);

    //设置环形图数据
    setPieDatas();

    //设置点击事件
    mPieChartView.setOnValueTouchListener(new ValueTouchListener());
}
 
开发者ID:lupwei,项目名称:Croprotector,代码行数:13,代码来源:disease_chart_fragment.java

示例5: onCreateView

import lecho.lib.hellocharts.view.PieChartView; //导入方法依赖的package包/类
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    overviewView = inflater.inflate(R.layout.fragment_overview, container, false);
    userLineSeparator = overviewView.findViewById(R.id.userLineSeparator);

    context = overviewView.getContext();

    txtTitleUser = (TextView) overviewView.findViewById(R.id.txtTitleUser);
    txtTitleLastMeasurement = (TextView) overviewView.findViewById(R.id.txtTitleLastMeasurment);

    tableOverviewLayout = (TableLayout)overviewView.findViewById(R.id.tableLayoutMeasurements);

    overviewMeasurements = new ArrayList<>();

    overviewMeasurements.add(new WeightMeasurementView(context));
    overviewMeasurements.add(new BMIMeasurementView(context));
    overviewMeasurements.add(new WaterMeasurementView(context));
    overviewMeasurements.add(new MuscleMeasurementView(context));
    overviewMeasurements.add(new LBWMeasurementView(context));
    overviewMeasurements.add(new FatMeasurementView(context));
    overviewMeasurements.add(new BoneMeasurementView(context));
    overviewMeasurements.add(new WaistMeasurementView(context));
    overviewMeasurements.add(new WHtRMeasurementView(context));
    overviewMeasurements.add(new HipMeasurementView(context));
    overviewMeasurements.add(new WHRMeasurementView(context));
    overviewMeasurements.add(new BMRMeasurementView(context));

    for (MeasurementView measurement : overviewMeasurements) {
        tableOverviewLayout.addView(measurement);
    }

    pieChartLast = (PieChartView) overviewView.findViewById(R.id.pieChartLast);
    lineChartLast = (LineChartView) overviewView.findViewById(R.id.lineChartLast);

    spinUser = (Spinner) overviewView.findViewById(R.id.spinUser);

    lineChartLast.setOnValueTouchListener(new LineChartTouchListener());

    pieChartLast.setOnValueTouchListener(new PieChartLastTouchListener());
    pieChartLast.setChartRotationEnabled(false);

    userSelectedData = null;

    spinUserAdapter = new ArrayAdapter<>(overviewView.getContext(), R.layout.support_simple_spinner_dropdown_item, new ArrayList<String>());
    spinUser.setAdapter(spinUserAdapter);

    // Set item select listener after spinner is created because otherwise item listener fires a lot!?!?
    spinUser.post(new Runnable() {
        public void run() {
            spinUser.setOnItemSelectedListener(new spinUserSelectionListener());
            updateUserSelection();
        }
    });

    OpenScale.getInstance(getContext()).registerFragment(this);

    return overviewView;
}
 
开发者ID:oliexdev,项目名称:openScale,代码行数:59,代码来源:OverviewFragment.java


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