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


Java PieChart.setHighlightPerTapEnabled方法代码示例

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


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

示例1: formatPieChart

import com.github.mikephil.charting.charts.PieChart; //导入方法依赖的package包/类
private void formatPieChart(PieChart pieChart) {
    pieChart.setUsePercentValues(true);
    pieChart.getDescription().setEnabled(false);
    pieChart.setDrawHoleEnabled(true);
    pieChart.setHoleColor(context.getResources().getColor(R.color.colorPrimaryDark));
    pieChart.setTransparentCircleColor(Color.GRAY);
    pieChart.setTransparentCircleAlpha(110);

    pieChart.setRotationAngle(0);
    pieChart.setRotationEnabled(true);
    pieChart.setHighlightPerTapEnabled(true);

    pieChart.setEntryLabelColor(Color.WHITE);
    pieChart.setDrawEntryLabels(false);
    pieChart.setBackground(context.getResources().getDrawable(R.color.colorPrimaryDark));
}
 
开发者ID:Protino,项目名称:CodeWatch,代码行数:17,代码来源:ChartFragment.java

示例2: setDefaultPieChartConfig

import com.github.mikephil.charting.charts.PieChart; //导入方法依赖的package包/类
public static PieChart setDefaultPieChartConfig(PieChart chart) {
    chart.setDrawHoleEnabled(true);
    chart.setHoleColor(Color.WHITE);
    chart.setTransparentCircleColor(Color.WHITE);
    chart.setTransparentCircleAlpha(110);
    chart.setDragDecelerationFrictionCoef(0.95f);
    chart.setHoleRadius(58f);
    chart.setTransparentCircleRadius(61f);
    chart.setDescription("");
    chart.setUsePercentValues(true);
    chart.setEntryLabelColor(Color.WHITE);
    chart.setDrawCenterText(true);
    chart.setCenterTextSize(18f);
    chart.setCenterTextColor(ContextCompat.getColor(chart.getContext(), R.color.colorSecondaryText));
    chart.setRotationAngle(0);
    chart.setRotationEnabled(true);
    chart.setHighlightPerTapEnabled(true);
    chart.setMaxHighlightDistance(400f);
    chart.setCenterTextTypeface(Typeface.createFromAsset(chart.getContext().getAssets(), "fonts/Lato-Regular.ttf"));
    chart.setEntryLabelTypeface(Typeface.createFromAsset(chart.getContext().getAssets(), "fonts/Lato-Regular.ttf"));
    chart.animateY(1400, Easing.EasingOption.EaseInOutQuad);
    return chart;
}
 
开发者ID:omgitsjoao,项目名称:wakatime-android-client,代码行数:24,代码来源:Charts.java

示例3: onCreate

import com.github.mikephil.charting.charts.PieChart; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
            WindowManager.LayoutParams.FLAG_FULLSCREEN);
    setContentView(R.layout.activity_piechart);

    tvX = (TextView) findViewById(R.id.tvXMax);
    tvY = (TextView) findViewById(R.id.tvYMax);

    mSeekBarX = (SeekBar) findViewById(R.id.seekBar1);
    mSeekBarY = (SeekBar) findViewById(R.id.seekBar2);
    mSeekBarX.setProgress(4);
    mSeekBarY.setProgress(10);

    mChart = (PieChart) findViewById(R.id.chart1);
    mChart.setUsePercentValues(true);
    mChart.getDescription().setEnabled(false);
    mChart.setExtraOffsets(5, 10, 5, 5);

    mChart.setDragDecelerationFrictionCoef(0.95f);

    mChart.setCenterTextTypeface(mTfLight);
    mChart.setCenterText(generateCenterSpannableText());

    mChart.setDrawHoleEnabled(true);
    mChart.setHoleColor(Color.WHITE);

    mChart.setTransparentCircleColor(Color.WHITE);
    mChart.setTransparentCircleAlpha(110);

    mChart.setHoleRadius(58f);
    mChart.setTransparentCircleRadius(61f);

    mChart.setDrawCenterText(true);

    mChart.setRotationAngle(0);
    // enable rotation of the chart by touch
    mChart.setRotationEnabled(true);
    mChart.setHighlightPerTapEnabled(true);

    // mChart.setUnit(" €");
    // mChart.setDrawUnitsInChart(true);

    // add a selection listener
    mChart.setOnChartValueSelectedListener(this);

    setData(4, 100);

    mChart.animateY(1400, Easing.EasingOption.EaseInOutQuad);
    // mChart.spin(2000, 0, 360);

    mSeekBarX.setOnSeekBarChangeListener(this);
    mSeekBarY.setOnSeekBarChangeListener(this);

    Legend l = mChart.getLegend();
    l.setVerticalAlignment(Legend.LegendVerticalAlignment.TOP);
    l.setHorizontalAlignment(Legend.LegendHorizontalAlignment.RIGHT);
    l.setOrientation(Legend.LegendOrientation.VERTICAL);
    l.setDrawInside(false);
    l.setXEntrySpace(7f);
    l.setYEntrySpace(0f);
    l.setYOffset(0f);

    // entry label styling
    mChart.setEntryLabelColor(Color.WHITE);
    mChart.setEntryLabelTypeface(mTfRegular);
    mChart.setEntryLabelTextSize(12f);
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:70,代码来源:PieChartActivity.java

示例4: setPieChart

import com.github.mikephil.charting.charts.PieChart; //导入方法依赖的package包/类
/**
 * Set the pie pattern
 * @param pieChart chart
 * @param chartData pie chart data
 * @param title chart title
 * @param tf Typeface font
 */
public static void setPieChart(PieChart pieChart, ChartData<?> chartData,
                               SpannableString title, Typeface tf) {
    chartData.setValueFormatter(new PercentFormatter());
    chartData.setValueTextSize(11f);
    chartData.setValueTextColor(Color.BLACK);
    chartData.setValueTypeface(tf);

    pieChart.setUsePercentValues(true);
    pieChart.getDescription().setEnabled(false);
    pieChart.setExtraOffsets(5, 10, 5, 5);
    pieChart.setDragDecelerationFrictionCoef(0.95f);
    pieChart.setCenterTextTypeface(tf);
    pieChart.setCenterText(title);
    pieChart.setExtraOffsets(20.f, 0.f, 20.f, 0.f);
    pieChart.setDrawHoleEnabled(true);
    pieChart.setHoleColor(Color.WHITE);
    pieChart.setTransparentCircleColor(Color.WHITE);
    pieChart.setTransparentCircleAlpha(110);
    pieChart.setHoleRadius(58f);
    pieChart.setTransparentCircleRadius(61f);
    pieChart.setDrawCenterText(true);
    pieChart.setRotationAngle(0);
    pieChart.setRotationEnabled(true);// enable rotation of the chart by touch
    pieChart.setHighlightPerTapEnabled(true);
    pieChart.setEntryLabelTextSize(10f);

    Legend l = pieChart.getLegend();
    l.setVerticalAlignment(Legend.LegendVerticalAlignment.TOP);
    l.setHorizontalAlignment(Legend.LegendHorizontalAlignment.RIGHT);
    l.setOrientation(Legend.LegendOrientation.VERTICAL);
    l.setDrawInside(false);
    l.setEnabled(false);

    pieChart.setData((PieData) chartData);
    pieChart.animateY(DURATION_MEDIUM, Easing.EasingOption.EaseInOutQuad);
    pieChart.highlightValues(null);// undo all highlights
    pieChart.invalidate();

}
 
开发者ID:graviton57,项目名称:DOUSalaries,代码行数:47,代码来源:ChartHelper.java

示例5: seteffect

import com.github.mikephil.charting.charts.PieChart; //导入方法依赖的package包/类
private void seteffect(PieChart colorPie) {

        colorPie.animateXY(2000, 2000, Easing.EasingOption.EaseInBounce, Easing.EasingOption.EaseInBounce);
        colorPie.invalidate();
        colorPie.setDrawHoleEnabled(true);
        colorPie.setExtraOffsets(10, 10, 10, 10);

        colorPie.setContentDescription("");
        colorPie.setDragDecelerationFrictionCoef(0.95f);
        colorPie.setDrawCenterText(true);

        colorPie.setRotationAngle(0);
        // enable rotation of the chart by touch
        colorPie.setRotationEnabled(true);
        colorPie.setHighlightPerTapEnabled(true);
        colorPie.setDrawHoleEnabled(true);
        colorPie.setHoleColor(Color.WHITE);

        //disable the label and description
        colorPie.getDescription().setEnabled(false);
        colorPie.getLegend().setEnabled(false);

        colorPie.setTransparentCircleColor(Color.WHITE);
        colorPie.setTransparentCircleAlpha(80);
        colorPie.setElevation(10f);
        colorPie.setHoleRadius(60f);
        colorPie.setTransparentCircleRadius(61f);

        // add a selection listener
        colorPie.setOnChartValueSelectedListener(this);

    }
 
开发者ID:clementf2b,项目名称:FaceT,代码行数:33,代码来源:ColorDetectionActivity.java

示例6: setEffectPieChart

import com.github.mikephil.charting.charts.PieChart; //导入方法依赖的package包/类
private void setEffectPieChart(PieChart colorPie) {

        colorPie.animateXY(1500, 1500, Easing.EasingOption.EaseInBounce, Easing.EasingOption.EaseInBounce);
        colorPie.invalidate();
        colorPie.setDrawHoleEnabled(true);
        colorPie.setExtraOffsets(10, 10, 10, 10);

        colorPie.setContentDescription("");
        colorPie.setDragDecelerationFrictionCoef(0.95f);
        colorPie.setDrawCenterText(true);

        colorPie.setRotationAngle(0);
        // enable rotation of the chart by touch
        colorPie.setRotationEnabled(true);
        colorPie.setHighlightPerTapEnabled(true);
        colorPie.setDrawHoleEnabled(true);
        colorPie.setHoleColor(Color.WHITE);
        colorPie.getLegend().setFormSize(10f);
        colorPie.getLegend().setFormToTextSpace(5f);

        //disable the label and description
        colorPie.getDescription().setEnabled(false);
        colorPie.getLegend().setEnabled(false);

        colorPie.setTransparentCircleColor(Color.WHITE);
        colorPie.setTransparentCircleAlpha(80);
        colorPie.setElevation(10f);
        colorPie.setHoleRadius(90f);
        colorPie.setTransparentCircleRadius(61f);

        // add a selection listener
        colorPie.setOnChartValueSelectedListener(this);

    }
 
开发者ID:clementf2b,项目名称:FaceT,代码行数:35,代码来源:ProductDetailActivity.java

示例7: preparePieChart

import com.github.mikephil.charting.charts.PieChart; //导入方法依赖的package包/类
public PieChart preparePieChart(PieChart pieChart) {
    pieChart.setUsePercentValues(true);
    pieChart.getDescription().setEnabled(false);
    pieChart.setExtraOffsets(5, 10, 5, 5);
    pieChart.setDragDecelerationFrictionCoef(0.96f);

    pieChart.setDrawHoleEnabled(true);
    pieChart.setHoleColor(android.R.color.transparent);

    pieChart.setTransparentCircleColor(utilsUI.getColor(android.R.color.white));
    pieChart.setTransparentCircleAlpha(50);

    pieChart.setHoleRadius(40f);
    pieChart.setTransparentCircleRadius(45f);

    pieChart.setDrawCenterText(true);
    pieChart.setCenterText("Balance");

    pieChart.setRotationAngle(0);
    // enable rotation of the chart by touch
    pieChart.setRotationEnabled(false);
    pieChart.setHighlightPerTapEnabled(true);
    pieChart.setDrawEntryLabels(true);
    pieChart.setEntryLabelColor(utilsUI.getColor(android.R.color.white));
    pieChart.setEntryLabelTextSize(15f);

    Legend l = pieChart.getLegend();
    l.setVerticalAlignment(Legend.LegendVerticalAlignment.BOTTOM);
    l.setHorizontalAlignment(Legend.LegendHorizontalAlignment.CENTER);
    l.setOrientation(Legend.LegendOrientation.HORIZONTAL);
    l.setDrawInside(false);

    return pieChart;
}
 
开发者ID:MLSDev,项目名称:RecipeFinderJavaVersion,代码行数:35,代码来源:DiagramUtils.java

示例8: onCreate

import com.github.mikephil.charting.charts.PieChart; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
            WindowManager.LayoutParams.FLAG_FULLSCREEN);
    setContentView(R.layout.activity_piechart);

    tvX = (TextView) findViewById(R.id.tvXMax);
    tvY = (TextView) findViewById(R.id.tvYMax);

    mSeekBarX = (SeekBar) findViewById(R.id.seekBar1);
    mSeekBarY = (SeekBar) findViewById(R.id.seekBar2);

    mSeekBarY.setProgress(10);

    mSeekBarX.setOnSeekBarChangeListener(this);
    mSeekBarY.setOnSeekBarChangeListener(this);

    mChart = (PieChart) findViewById(R.id.chart1);
    mChart.setUsePercentValues(true);
    mChart.getDescription().setEnabled(false);
    mChart.setExtraOffsets(5, 10, 5, 5);

    mChart.setDragDecelerationFrictionCoef(0.95f);

    tf = Typeface.createFromAsset(getAssets(), "OpenSans-Regular.ttf");

    mChart.setCenterTextTypeface(Typeface.createFromAsset(getAssets(), "OpenSans-Light.ttf"));
    mChart.setCenterText(generateCenterSpannableText());

    mChart.setExtraOffsets(20.f, 0.f, 20.f, 0.f);

    mChart.setDrawHoleEnabled(true);
    mChart.setHoleColor(Color.WHITE);

    mChart.setTransparentCircleColor(Color.WHITE);
    mChart.setTransparentCircleAlpha(110);

    mChart.setHoleRadius(58f);
    mChart.setTransparentCircleRadius(61f);

    mChart.setDrawCenterText(true);

    mChart.setRotationAngle(0);
    // enable rotation of the chart by touch
    mChart.setRotationEnabled(true);
    mChart.setHighlightPerTapEnabled(true);

    // mChart.setUnit(" €");
    // mChart.setDrawUnitsInChart(true);

    // add a selection listener
    mChart.setOnChartValueSelectedListener(this);

    setData(4, 100);

    mChart.animateY(1400, Easing.EasingOption.EaseInOutQuad);
    // mChart.spin(2000, 0, 360);

    Legend l = mChart.getLegend();
    l.setVerticalAlignment(Legend.LegendVerticalAlignment.TOP);
    l.setHorizontalAlignment(Legend.LegendHorizontalAlignment.RIGHT);
    l.setOrientation(Legend.LegendOrientation.VERTICAL);
    l.setDrawInside(false);
    l.setEnabled(false);
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:67,代码来源:PiePolylineChartActivity.java

示例9: onCreate

import com.github.mikephil.charting.charts.PieChart; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
            WindowManager.LayoutParams.FLAG_FULLSCREEN);
    setContentView(R.layout.activity_piechart_half);

    mChart = (PieChart) findViewById(R.id.chart1);
    mChart.setBackgroundColor(Color.WHITE);

    moveOffScreen();

    mChart.setUsePercentValues(true);
    mChart.getDescription().setEnabled(false);

    mChart.setCenterTextTypeface(mTfLight);
    mChart.setCenterText(generateCenterSpannableText());

    mChart.setDrawHoleEnabled(true);
    mChart.setHoleColor(Color.WHITE);

    mChart.setTransparentCircleColor(Color.WHITE);
    mChart.setTransparentCircleAlpha(110);

    mChart.setHoleRadius(58f);
    mChart.setTransparentCircleRadius(61f);

    mChart.setDrawCenterText(true);

    mChart.setRotationEnabled(false);
    mChart.setHighlightPerTapEnabled(true);

    mChart.setMaxAngle(180f); // HALF CHART
    mChart.setRotationAngle(180f);
    mChart.setCenterTextOffset(0, -20);

    setData(4, 100);

    mChart.animateY(1400, Easing.EasingOption.EaseInOutQuad);

    Legend l = mChart.getLegend();
    l.setVerticalAlignment(Legend.LegendVerticalAlignment.TOP);
    l.setHorizontalAlignment(Legend.LegendHorizontalAlignment.CENTER);
    l.setOrientation(Legend.LegendOrientation.HORIZONTAL);
    l.setDrawInside(false);
    l.setXEntrySpace(7f);
    l.setYEntrySpace(0f);
    l.setYOffset(0f);

    // entry label styling
    mChart.setEntryLabelColor(Color.WHITE);
    mChart.setEntryLabelTypeface(mTfRegular);
    mChart.setEntryLabelTextSize(12f);
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:55,代码来源:HalfPieChartActivity.java

示例10: onCreate

import com.github.mikephil.charting.charts.PieChart; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
            WindowManager.LayoutParams.FLAG_FULLSCREEN);
    setContentView(R.layout.activity_piechart);

    tvX = (TextView) findViewById(R.id.tvXMax);
    tvY = (TextView) findViewById(R.id.tvYMax);

    mSeekBarX = (SeekBar) findViewById(R.id.seekBar1);
    mSeekBarY = (SeekBar) findViewById(R.id.seekBar2);

    mSeekBarY.setProgress(10);

    mSeekBarX.setOnSeekBarChangeListener(this);
    mSeekBarY.setOnSeekBarChangeListener(this);

    mChart = (PieChart) findViewById(R.id.chart1);
    mChart.setUsePercentValues(true);
    mChart.setDescription("");
    mChart.setExtraOffsets(5, 10, 5, 5);

    mChart.setDragDecelerationFrictionCoef(0.95f);

    tf = Typeface.createFromAsset(getAssets(), "OpenSans-Regular.ttf");

    mChart.setCenterTextTypeface(Typeface.createFromAsset(getAssets(), "OpenSans-Light.ttf"));
    mChart.setCenterText(generateCenterSpannableText());

    mChart.setDrawHoleEnabled(true);
    mChart.setHoleColor(Color.WHITE);

    mChart.setTransparentCircleColor(Color.WHITE);
    mChart.setTransparentCircleAlpha(110);

    mChart.setHoleRadius(58f);
    mChart.setTransparentCircleRadius(61f);

    mChart.setDrawCenterText(true);

    mChart.setRotationAngle(0);
    // enable rotation of the chart by touch
    mChart.setRotationEnabled(true);
    mChart.setHighlightPerTapEnabled(true);

    // mChart.setUnit(" €");
    // mChart.setDrawUnitsInChart(true);

    // add a selection listener
    mChart.setOnChartValueSelectedListener(this);

    setData(3, 100);

    mChart.animateY(1400, Easing.EasingOption.EaseInOutQuad);
    // mChart.spin(2000, 0, 360);

    Legend l = mChart.getLegend();
    l.setPosition(LegendPosition.RIGHT_OF_CHART);
    l.setXEntrySpace(7f);
    l.setYEntrySpace(0f);
    l.setYOffset(0f);
}
 
开发者ID:rahulmaddineni,项目名称:Stayfit,代码行数:64,代码来源:PieChartActivity.java

示例11: onCreate

import com.github.mikephil.charting.charts.PieChart; //导入方法依赖的package包/类
@Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
//        getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
//                WindowManager.LayoutParams.FLAG_FULLSCREEN);
        setContentView(R.layout.activity_chart_pie);

        try {
            tvX = (TextView) findViewById(R.id.tvXMax);
            tvY = (TextView) findViewById(R.id.tvYMax);

            mSeekBarX = (SeekBar) findViewById(R.id.seekBar1);
            mSeekBarY = (SeekBar) findViewById(R.id.seekBar2);

            mSeekBarY.setProgress(10);

            mSeekBarX.setOnSeekBarChangeListener(this);
            mSeekBarY.setOnSeekBarChangeListener(this);

            mChart = (PieChart) findViewById(R.id.chart1);
            mChart.setUsePercentValues(true);
            mChart.setDescription("");
            mChart.setExtraOffsets(5, 10, 5, 5);

            mChart.setDragDecelerationFrictionCoef(0.95f);

            tf = Typeface.createFromAsset(getAssets(), "OpenSans-Regular.ttf");

            // 设置圆盘中间区域的字体
            mChart.setCenterTextTypeface(Typeface.createFromAsset(getAssets(), "OpenSans-Light.ttf"));
            mChart.setCenterText(generateCenterSpannableText());

            mChart.setDrawHoleEnabled(true);
            mChart.setHoleColor(Color.WHITE);

            mChart.setTransparentCircleColor(Color.WHITE);
            mChart.setTransparentCircleAlpha(110);

            mChart.setHoleRadius(58f);
            mChart.setTransparentCircleRadius(61f);

            mChart.setDrawCenterText(true);

            mChart.setRotationAngle(0);
            // enable rotation of the chart by touch
            mChart.setRotationEnabled(true);
            mChart.setHighlightPerTapEnabled(true);

            // mChart.setUnit(" €");
            // mChart.setDrawUnitsInChart(true);

            // add a selection listener
            mChart.setOnChartValueSelectedListener(this);

            setData(3, 100);

            mChart.animateY(1400, Easing.EasingOption.EaseInOutQuad);
            // mChart.spin(2000, 0, 360);

            Legend l = mChart.getLegend();
            l.setPosition(Legend.LegendPosition.RIGHT_OF_CHART);
            l.setXEntrySpace(7f);
            l.setYEntrySpace(0f);
            l.setYOffset(0f);
        } catch (Exception e) {
            e.printStackTrace();
        }


    }
 
开发者ID:zhangxx0,项目名称:FirstCodeUtil,代码行数:71,代码来源:AtyChartPie.java

示例12: onCreate

import com.github.mikephil.charting.charts.PieChart; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_graph);

    cacheFiles = (TextView)findViewById(R.id.cache_files);
    dataFiles = (TextView)findViewById(R.id.data_files);
    systemFiles = (TextView)findViewById(R.id.system_files);

    cacheTitle = (TextView)findViewById(R.id.cache_title);
    dataTitle = (TextView)findViewById(R.id.data_title);
    systemTitle = (TextView)findViewById(R.id.system_title);

    mParts.add("Cache");
    mParts.add("Data");
    mParts.add("System");

    mPieParts.add("RR");
    mPieParts.add("RW");
    mPieParts.add("SR");
    mPieParts.add("SW");


    graphData = new GraphData();
    btnParse = (Button)findViewById(R.id.bt_parse);
    btnParse.setOnClickListener(this);

    progressDialog = new ProgressDialog(this);
    progressDialog.setProgressStyle(ProgressDialog.STYLE_SPINNER);
    progressDialog.setCancelable(false);

    partBartChart = (BarChart)findViewById(R.id.part_bar_chart);
    partBartChart.setDrawGridBackground(false);
    partBartChart.setDescription("");
    // I don't want handle touch event
    partBartChart.setTouchEnabled(false);

    Legend l = partBartChart.getLegend();
    l.setPosition(Legend.LegendPosition.RIGHT_OF_CHART_INSIDE);
    l.setYOffset(0f);
    l.setYEntrySpace(0f);
    l.setTextSize(8f);

    XAxis xl = partBartChart.getXAxis();
    xl.setPosition(XAxis.XAxisPosition.BOTTOM);

    YAxis leftAxis = partBartChart.getAxisLeft();
    leftAxis.setDrawGridLines(false);
    leftAxis.setSpaceTop(30f);
    leftAxis.setAxisMinValue(0);
    leftAxis.setValueFormatter(new LargeValueFormatter());
    partBartChart.getAxisRight().setEnabled(false);

    BarData barData = new BarData();
    barData.addXValue(mParts.get(0));
    barData.addXValue(mParts.get(1));
    barData.addXValue(mParts.get(2));
    partBartChart.setData(barData);
    partBartChart.invalidate();

    ioPercentChart = (PieChart)findViewById(R.id.io_percent);
    ioPercentChart.setUsePercentValues(true);
    ioPercentChart.setDescription("");
    ioPercentChart.animateY(1400, Easing.EasingOption.EaseInOutQuad);
    ioPercentChart.setRotationAngle(0);
    // enable rotation of the chart by touch
    ioPercentChart.setRotationEnabled(true);
    ioPercentChart.setHighlightPerTapEnabled(true);

    Legend pieL = ioPercentChart.getLegend();
    pieL.setPosition(Legend.LegendPosition.RIGHT_OF_CHART);
    pieL.setXEntrySpace(7f);
    pieL.setYEntrySpace(0f);
    pieL.setYOffset(0f);

}
 
开发者ID:cumtsmart,项目名称:MostTool,代码行数:77,代码来源:GraphActivity.java


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