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


Java LineData.setValueTypeface方法代码示例

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


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

示例1: generateLineData

import com.github.mikephil.charting.data.LineData; //导入方法依赖的package包/类
protected LineData generateLineData() {
    
    ArrayList<ILineDataSet> sets = new ArrayList<ILineDataSet>();
    
    LineDataSet ds1 = new LineDataSet(FileUtils.loadEntriesFromAssets(getActivity().getAssets(), "sine.txt"), "Sine function");
    LineDataSet ds2 = new LineDataSet(FileUtils.loadEntriesFromAssets(getActivity().getAssets(), "cosine.txt"), "Cosine function");
    
    ds1.setLineWidth(2f);
    ds2.setLineWidth(2f);
    
    ds1.setDrawCircles(false);
    ds2.setDrawCircles(false);
    
    ds1.setColor(ColorTemplate.VORDIPLOM_COLORS[0]);
    ds2.setColor(ColorTemplate.VORDIPLOM_COLORS[1]);
    
    // load DataSets from textfiles in assets folders
    sets.add(ds1);
    sets.add(ds2);
    
    LineData d = new LineData(sets);
    d.setValueTypeface(tf);
    return d;
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:25,代码来源:SimpleFragment.java

示例2: onCreate

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

    mCharts[0] = (LineChart) findViewById(R.id.chart1);
    mCharts[1] = (LineChart) findViewById(R.id.chart2);
    mCharts[2] = (LineChart) findViewById(R.id.chart3);
    mCharts[3] = (LineChart) findViewById(R.id.chart4);

    mTf = Typeface.createFromAsset(getAssets(), "OpenSans-Bold.ttf");

    for (int i = 0; i < mCharts.length; i++) {

        LineData data = getData(36, 100);
        data.setValueTypeface(mTf);

        // add some transparency to the color with "& 0x90FFFFFF"
        setupChart(mCharts[i], data, mColors[i % mColors.length]);
    }
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:24,代码来源:LineChartActivityColored.java

示例3: onCreate

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

    mCharts[0] = (LineChart) findViewById(R.id.chart1);
    mCharts[1] = (LineChart) findViewById(R.id.chart2);
    mCharts[2] = (LineChart) findViewById(R.id.chart3);
    mCharts[3] = (LineChart) findViewById(R.id.chart4);

    mTf = Typeface.createFromAsset(getAssets(), "OpenSans-Bold.ttf");

    LineData data = getData(36, 100);
    data.setValueTypeface(mTf);

    for (int i = 0; i < mCharts.length; i++)
        // add some transparency to the color with "& 0x90FFFFFF"
        setupChart(mCharts[i], data, mColors[i % mColors.length]);
}
 
开发者ID:rahulmaddineni,项目名称:Stayfit,代码行数:22,代码来源:LineChartActivityColored.java

示例4: generateLineData

import com.github.mikephil.charting.data.LineData; //导入方法依赖的package包/类
/**
 * Generate line data line data.
 *
 * @return the line data
 */
protected LineData generateLineData() {

    ArrayList<ILineDataSet> sets = new ArrayList<ILineDataSet>();

    LineDataSet ds1 = new LineDataSet(FileUtils.loadEntriesFromAssets(getActivity().getAssets(), "sine.txt"), "Sine function");
    LineDataSet ds2 = new LineDataSet(FileUtils.loadEntriesFromAssets(getActivity().getAssets(), "cosine.txt"), "Cosine function");

    ds1.setLineWidth(2f);
    ds2.setLineWidth(2f);

    ds1.setDrawCircles(false);
    ds2.setDrawCircles(false);

    ds1.setColor(ColorTemplate.VORDIPLOM_COLORS[0]);
    ds2.setColor(ColorTemplate.VORDIPLOM_COLORS[1]);

    // load DataSets from textfiles in assets folders
    sets.add(ds1);
    sets.add(ds2);

    LineData d = new LineData(sets);
    d.setValueTypeface(tf);
    return d;
}
 
开发者ID:bounswe,项目名称:bounswe2016group2,代码行数:30,代码来源:userHomeFragment.java

示例5: getComplexity

import com.github.mikephil.charting.data.LineData; //导入方法依赖的package包/类
protected LineData getComplexity() {
    
    ArrayList<ILineDataSet> sets = new ArrayList<ILineDataSet>();
    
    LineDataSet ds1 = new LineDataSet(FileUtils.loadEntriesFromAssets(getActivity().getAssets(), "n.txt"), "O(n)");
    LineDataSet ds2 = new LineDataSet(FileUtils.loadEntriesFromAssets(getActivity().getAssets(), "nlogn.txt"), "O(nlogn)");
    LineDataSet ds3 = new LineDataSet(FileUtils.loadEntriesFromAssets(getActivity().getAssets(), "square.txt"), "O(n\u00B2)");
    LineDataSet ds4 = new LineDataSet(FileUtils.loadEntriesFromAssets(getActivity().getAssets(), "three.txt"), "O(n\u00B3)");
    
    ds1.setColor(ColorTemplate.VORDIPLOM_COLORS[0]);
    ds2.setColor(ColorTemplate.VORDIPLOM_COLORS[1]);
    ds3.setColor(ColorTemplate.VORDIPLOM_COLORS[2]);
    ds4.setColor(ColorTemplate.VORDIPLOM_COLORS[3]);
    
    ds1.setCircleColor(ColorTemplate.VORDIPLOM_COLORS[0]);
    ds2.setCircleColor(ColorTemplate.VORDIPLOM_COLORS[1]);
    ds3.setCircleColor(ColorTemplate.VORDIPLOM_COLORS[2]);
    ds4.setCircleColor(ColorTemplate.VORDIPLOM_COLORS[3]);
    
    ds1.setLineWidth(2.5f);
    ds1.setCircleRadius(3f);
    ds2.setLineWidth(2.5f);
    ds2.setCircleRadius(3f);
    ds3.setLineWidth(2.5f);
    ds3.setCircleRadius(3f);
    ds4.setLineWidth(2.5f);
    ds4.setCircleRadius(3f);
    
    
    // load DataSets from textfiles in assets folders
    sets.add(ds1);        
    sets.add(ds2);
    sets.add(ds3);
    sets.add(ds4);
    
    LineData d = new LineData(sets);
    d.setValueTypeface(tf);
    return d;
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:40,代码来源:SimpleFragment.java

示例6: generateLineData

import com.github.mikephil.charting.data.LineData; //导入方法依赖的package包/类
protected LineData generateLineData() {
        
//        DataSet ds1 = new DataSet(n, "O(n)");  
//        DataSet ds2 = new DataSet(nlogn, "O(nlogn)"); 
//        DataSet ds3 = new DataSet(nsquare, "O(n\u00B2)");
//        DataSet ds4 = new DataSet(nthree, "O(n\u00B3)");
        
        ArrayList<ILineDataSet> sets = new ArrayList<ILineDataSet>();
        
        LineDataSet ds1 = new LineDataSet(FileUtils.loadEntriesFromAssets(getActivity().getAssets(), "sine.txt"), "Sine function");
        LineDataSet ds2 = new LineDataSet(FileUtils.loadEntriesFromAssets(getActivity().getAssets(), "cosine.txt"), "Cosine function");
        
        ds1.setLineWidth(2f);
        ds2.setLineWidth(2f);
        
        ds1.setDrawCircles(false);
        ds2.setDrawCircles(false);
        
        ds1.setColor(ColorTemplate.VORDIPLOM_COLORS[0]);
        ds2.setColor(ColorTemplate.VORDIPLOM_COLORS[1]);
        
        // load DataSets from textfiles in assets folders
        sets.add(ds1);
        sets.add(ds2);
        
//        sets.add(FileUtils.dataSetFromAssets(getActivity().getAssets(), "n.txt"));
//        sets.add(FileUtils.dataSetFromAssets(getActivity().getAssets(), "nlogn.txt"));
//        sets.add(FileUtils.dataSetFromAssets(getActivity().getAssets(), "square.txt"));
//        sets.add(FileUtils.dataSetFromAssets(getActivity().getAssets(), "three.txt"));
        
        int max = Math.max(sets.get(0).getEntryCount(), sets.get(1).getEntryCount());
        
        LineData d = new LineData(ChartData.generateXVals(0, max),  sets);
        d.setValueTypeface(tf);
        return d;
    }
 
开发者ID:rahulmaddineni,项目名称:Stayfit,代码行数:37,代码来源:SimpleFragment.java

示例7: getComplexity

import com.github.mikephil.charting.data.LineData; //导入方法依赖的package包/类
protected LineData getComplexity() {
    
    ArrayList<ILineDataSet> sets = new ArrayList<ILineDataSet>();
    
    LineDataSet ds1 = new LineDataSet(FileUtils.loadEntriesFromAssets(getActivity().getAssets(), "n.txt"), "O(n)");
    LineDataSet ds2 = new LineDataSet(FileUtils.loadEntriesFromAssets(getActivity().getAssets(), "nlogn.txt"), "O(nlogn)");
    LineDataSet ds3 = new LineDataSet(FileUtils.loadEntriesFromAssets(getActivity().getAssets(), "square.txt"), "O(n\u00B2)");
    LineDataSet ds4 = new LineDataSet(FileUtils.loadEntriesFromAssets(getActivity().getAssets(), "three.txt"), "O(n\u00B3)");
    
    ds1.setColor(ColorTemplate.VORDIPLOM_COLORS[0]);
    ds2.setColor(ColorTemplate.VORDIPLOM_COLORS[1]);
    ds3.setColor(ColorTemplate.VORDIPLOM_COLORS[2]);
    ds4.setColor(ColorTemplate.VORDIPLOM_COLORS[3]);
    
    ds1.setCircleColor(ColorTemplate.VORDIPLOM_COLORS[0]);
    ds2.setCircleColor(ColorTemplate.VORDIPLOM_COLORS[1]);
    ds3.setCircleColor(ColorTemplate.VORDIPLOM_COLORS[2]);
    ds4.setCircleColor(ColorTemplate.VORDIPLOM_COLORS[3]);
    
    ds1.setLineWidth(2.5f);
    ds1.setCircleRadius(3f);
    ds2.setLineWidth(2.5f);
    ds2.setCircleRadius(3f);
    ds3.setLineWidth(2.5f);
    ds3.setCircleRadius(3f);
    ds4.setLineWidth(2.5f);
    ds4.setCircleRadius(3f);
    
    
    // load DataSets from textfiles in assets folders
    sets.add(ds1);        
    sets.add(ds2);
    sets.add(ds3);
    sets.add(ds4);
    
    LineData d = new LineData(ChartData.generateXVals(0, ds1.getEntryCount()), sets);
    d.setValueTypeface(tf);
    return d;
}
 
开发者ID:rahulmaddineni,项目名称:Stayfit,代码行数:40,代码来源:SimpleFragment.java

示例8: getComplexity

import com.github.mikephil.charting.data.LineData; //导入方法依赖的package包/类
/**
 * Gets complexity.
 *
 * @return the complexity
 */
protected LineData getComplexity() {

    ArrayList<ILineDataSet> sets = new ArrayList<ILineDataSet>();

    LineDataSet ds1 = new LineDataSet(FileUtils.loadEntriesFromAssets(getActivity().getAssets(), "n.txt"), "O(n)");
    LineDataSet ds2 = new LineDataSet(FileUtils.loadEntriesFromAssets(getActivity().getAssets(), "nlogn.txt"), "O(nlogn)");
    LineDataSet ds3 = new LineDataSet(FileUtils.loadEntriesFromAssets(getActivity().getAssets(), "square.txt"), "O(n\u00B2)");
    LineDataSet ds4 = new LineDataSet(FileUtils.loadEntriesFromAssets(getActivity().getAssets(), "three.txt"), "O(n\u00B3)");

    ds1.setColor(ColorTemplate.VORDIPLOM_COLORS[0]);
    ds2.setColor(ColorTemplate.VORDIPLOM_COLORS[1]);
    ds3.setColor(ColorTemplate.VORDIPLOM_COLORS[2]);
    ds4.setColor(ColorTemplate.VORDIPLOM_COLORS[3]);

    ds1.setCircleColor(ColorTemplate.VORDIPLOM_COLORS[0]);
    ds2.setCircleColor(ColorTemplate.VORDIPLOM_COLORS[1]);
    ds3.setCircleColor(ColorTemplate.VORDIPLOM_COLORS[2]);
    ds4.setCircleColor(ColorTemplate.VORDIPLOM_COLORS[3]);

    ds1.setLineWidth(2.5f);
    ds1.setCircleRadius(3f);
    ds2.setLineWidth(2.5f);
    ds2.setCircleRadius(3f);
    ds3.setLineWidth(2.5f);
    ds3.setCircleRadius(3f);
    ds4.setLineWidth(2.5f);
    ds4.setCircleRadius(3f);


    // load DataSets from textfiles in assets folders
    sets.add(ds1);
    sets.add(ds2);
    sets.add(ds3);
    sets.add(ds4);

    LineData d = new LineData(sets);
    d.setValueTypeface(tf);
    return d;
}
 
开发者ID:bounswe,项目名称:bounswe2016group2,代码行数:45,代码来源:userHomeFragment.java

示例9: setData

import com.github.mikephil.charting.data.LineData; //导入方法依赖的package包/类
private void setData(int count, float range) {

        ArrayList<String> xVals = new ArrayList<String>();
        for (int i = 0; i < count; i++) {
            xVals.add((1990 +i) + "");
        }

        ArrayList<Entry> vals1 = new ArrayList<Entry>();

        for (int i = 0; i < count; i++) {
            float mult = (range + 1);
            float val = (float) (Math.random() * mult) + 20;// + (float)
                                                           // ((mult *
                                                           // 0.1) / 10);
            vals1.add(new Entry(val, i));
        }
        
        // create a dataset and give it a type
        LineDataSet set1 = new LineDataSet(vals1, "DataSet 1");
        set1.setDrawCubic(true);
        set1.setCubicIntensity(0.2f);
        //set1.setDrawFilled(true);
        set1.setDrawCircles(false); 
        set1.setLineWidth(1.8f);
        set1.setCircleRadius(4f);
        set1.setCircleColor(Color.WHITE);
        set1.setHighLightColor(Color.rgb(244, 117, 117));
        set1.setColor(Color.WHITE);
        set1.setFillColor(Color.WHITE);
        set1.setFillAlpha(100);
        set1.setDrawHorizontalHighlightIndicator(false);
        set1.setFillFormatter(new FillFormatter() {
            @Override
            public float getFillLinePosition(ILineDataSet dataSet, LineDataProvider dataProvider) {
                return -10;
            }
        });
        
        // create a data object with the datasets
        LineData data = new LineData(xVals, set1);
        data.setValueTypeface(tf);
        data.setValueTextSize(9f);
        data.setDrawValues(false);

        // set data
        mChart.setData(data);
    }
 
开发者ID:rahulmaddineni,项目名称:Stayfit,代码行数:48,代码来源:CubicLineChartActivity.java


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