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


Java PieDataSet.setValueLinePart1OffsetPercentage方法代码示例

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


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

示例1: populatePieData

import com.github.mikephil.charting.data.PieDataSet; //导入方法依赖的package包/类
/**
 * Set the pie chart data source
 */
public static PieData populatePieData(List<PieEntry> entries, String label){
    PieDataSet dataSet = new PieDataSet(entries, label);
    dataSet.setSliceSpace(3f);
    dataSet.setSelectionShift(5f);
    //dataSet.setColors(populateColors());// add a lot of colors
    dataSet.setColors(ColorTemplate.MATERIAL_COLORS);
    dataSet.setValueLinePart1OffsetPercentage(80.f);
    dataSet.setValueLinePart1Length(0.2f);
    dataSet.setValueLinePart2Length(0.4f);
   // dataSet.setXValuePosition(PieDataSet.ValuePosition.OUTSIDE_SLICE);
    dataSet.setYValuePosition(PieDataSet.ValuePosition.OUTSIDE_SLICE);
    dataSet.setValueTextSize(11f);
    return new PieData(dataSet);
}
 
开发者ID:graviton57,项目名称:DOUSalaries,代码行数:18,代码来源:ChartHelper.java

示例2: setData

import com.github.mikephil.charting.data.PieDataSet; //导入方法依赖的package包/类
private void setData(long tips, long transactionsToRequest) {

        ArrayList<PieEntry> entries = new ArrayList<>();

        entries.add(new PieEntry(tips, getString(R.string.tips) + " " + "(" + tips + ")"));
        entries.add(new PieEntry(transactionsToRequest, getString(R.string.transactions_to_request) + " " + "(" + transactionsToRequest + ")"));

        PieDataSet dataSet = new PieDataSet(entries, getString(R.string.transactions) + "\n(" + (tips + transactionsToRequest) + ")");

        dataSet.setSliceSpace(3f);
        dataSet.setSelectionShift(5f);

        // add a lot of colors

        ArrayList<Integer> colors = new ArrayList<>();

        for (int c : ColorTemplate.LIBERTY_COLORS)
            colors.add(c);

        dataSet.setColors(colors);

        dataSet.setValueLinePart1OffsetPercentage(80.f);
        dataSet.setValueLinePart1Length(0.2f);
        dataSet.setValueLinePart2Length(0.4f);
        dataSet.setXValuePosition(PieDataSet.ValuePosition.OUTSIDE_SLICE);
        dataSet.setYValuePosition(PieDataSet.ValuePosition.OUTSIDE_SLICE);
        dataSet.setValueTextColor(ContextCompat.getColor(getActivity(), R.color.colorPrimary));

        PieData data = new PieData(dataSet);
        data.setValueFormatter(new PercentFormatter());
        data.setValueTextSize(12f);
        data.setValueTextColor(ContextCompat.getColor(getActivity(), R.color.colorPrimary));
        chart.setData(data);

        // undo all highlights
        chart.highlightValues(null);
        chart.invalidate();
    }
 
开发者ID:iotaledger,项目名称:android-wallet-app,代码行数:39,代码来源:NodeInfoFragment.java


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