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


Java LineDataSet.setLineWidth方法代码示例

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


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

示例1: prepareInitData

import com.github.mikephil.charting.data.LineDataSet; //导入方法依赖的package包/类
private LineDataSet prepareInitData(@NonNull LineChart chart, @NonNull List<Entry> entries) {
    final LineDataSet set = new LineDataSet(entries, "Accuracy");

    set.setMode(LineDataSet.Mode.HORIZONTAL_BEZIER);
    set.setAxisDependency(YAxis.AxisDependency.LEFT);
    set.setLineWidth(2F);
    set.setDrawCircleHole(false);
    set.setDrawCircles(false);
    set.setHighlightEnabled(false);
    set.setDrawFilled(true);

    final LineData group = new LineData(set);
    group.setDrawValues(false);

    chart.setData(group);

    return set;
}
 
开发者ID:huazhouwang,项目名称:Synapse,代码行数:19,代码来源:TrainedModelViewBinder.java

示例2: generateLineData

import com.github.mikephil.charting.data.LineDataSet; //导入方法依赖的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

示例3: createSet

import com.github.mikephil.charting.data.LineDataSet; //导入方法依赖的package包/类
private LineDataSet createSet() {

        LineDataSet set = new LineDataSet(null, "Dynamic Data");
        set.setAxisDependency(AxisDependency.LEFT);
        set.setColor(ColorTemplate.getHoloBlue());
        set.setCircleColor(Color.WHITE);
        set.setLineWidth(2f);
        set.setCircleRadius(4f);
        set.setFillAlpha(65);
        set.setFillColor(ColorTemplate.getHoloBlue());
        set.setHighLightColor(Color.rgb(244, 117, 117));
        set.setValueTextColor(Color.WHITE);
        set.setValueTextSize(9f);
        set.setDrawValues(false);
        return set;
    }
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:17,代码来源:RealtimeLineChartActivity.java

示例4: setData

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

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

        for (int i = 0; i < count; i++) {
            float xVal = (float) (Math.random() * range);
            float yVal = (float) (Math.random() * range);
            entries.add(new Entry(xVal, yVal));
        }

        // sort by x-value
        Collections.sort(entries, new EntryXComparator());

        // create a dataset and give it a type
        LineDataSet set1 = new LineDataSet(entries, "DataSet 1");

        set1.setLineWidth(1.5f);
        set1.setCircleRadius(4f);

        // create a data object with the datasets
        LineData data = new LineData(set1);

        // set data
        mChart.setData(data);
    }
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:26,代码来源:InvertedLineChartActivity.java

示例5: getData

import com.github.mikephil.charting.data.LineDataSet; //导入方法依赖的package包/类
private LineData getData(ArrayList<Entry> yVals) {
    LineDataSet set1 = new LineDataSet(yVals, "");
    set1.setLineWidth(1.45f);
    set1.setColor(Color.argb(240, 255, 255, 255));
    set1.setCircleColor(Color.WHITE);
    set1.setHighLightColor(Color.WHITE);
    set1.setFillColor(getResources().getColor(R.color.chartFilled));
    set1.setDrawCircles(false);
    set1.setDrawValues(false);
    set1.setDrawFilled(true);
    set1.setFillFormatter(new IFillFormatter() {
        @Override
        public float getFillLinePosition(ILineDataSet dataSet, LineDataProvider dataProvider) {
            return priceChart.getAxisLeft().getAxisMinimum();
        }
    });

    LineData data = new LineData(set1);
    return data;
}
 
开发者ID:manuelsc,项目名称:Lunary-Ethereum-Wallet,代码行数:21,代码来源:FragmentPrice.java

示例6: generateDataLine

import com.github.mikephil.charting.data.LineDataSet; //导入方法依赖的package包/类
/**
 * generates a random ChartData object with just one DataSet
 *
 * @return
 */

private LineData generateDataLine(float[] datas, String type) {

    ArrayList<Entry> entryList = new ArrayList<Entry>();
    for (int i = 0; i < datas.length; i++) {
        entryList.add(new Entry(i, datas[i]));
    }

    LineDataSet d1 = new LineDataSet(entryList, "DataSet :" + type);
    d1.setLineWidth(2.5f);
    Random r = new Random();
    d1.setHighLightColor(Color.rgb(r.nextInt(256), r.nextInt(256), r.nextInt(256)));
    d1.setDrawValues(false);

    ArrayList<ILineDataSet> sets = new ArrayList<>();
    sets.add(d1);

    return new LineData(sets);
}
 
开发者ID:Ksj7,项目名称:Rabbitqueue,代码行数:25,代码来源:MainActivity.java

示例7: createDataSet

import com.github.mikephil.charting.data.LineDataSet; //导入方法依赖的package包/类
/**
 * Creates a data set with the given label and color. Highlights and drawing of values and
 * circles are disabled, as that is common for many cases.
 *
 * @param label The label to assign to the new data set.
 * @param color The line color to set for the new data set.
 */
private LineDataSet createDataSet(String label, int color) {
    // A legend is enabled on the chart view in the graph fragment. The legend is created
    // automatically, but requires a unique labels and colors on each data set.
    final LineDataSet dataSet = new LineDataSet(null, label);

    // A dashed line can make peaks inaccurate. It also makes the graph look too "busy". It
    // is OK for some uses, such as progressions of best times, but that is left to the caller
    // to change once this new data set is returned.
    //
    // If graphing only times for a session, there will be fewer, and a thicker line will look
    // well. However, if all times are graphed, a thinner line will probably look better, as
    // the finer details will be more visible.
    dataSet.setLineWidth(getLineWidth());
    dataSet.setColor(color);
    dataSet.setHighlightEnabled(false);

    dataSet.setDrawCircles(false);
    dataSet.setDrawValues(false);

    return dataSet;
}
 
开发者ID:aricneto,项目名称:TwistyTimer,代码行数:29,代码来源:ChartStatistics.java

示例8: createSet

import com.github.mikephil.charting.data.LineDataSet; //导入方法依赖的package包/类
private LineDataSet createSet() {

        LineDataSet set = new LineDataSet(null, getString(R.string.app_name));
        set.setAxisDependency(YAxis.AxisDependency.LEFT);
        set.setColor(ColorTemplate.getHoloBlue());
        set.setCircleColor(Color.WHITE);
        set.setLineWidth(1f);
        set.setCircleRadius(1.5f);
        set.setFillAlpha(65);
        set.setFillColor(ColorTemplate.getHoloBlue());
        set.setHighLightColor(Color.rgb(244, 117, 117));
        set.setValueTextColor(Color.WHITE);
        set.setValueTextSize(9f);
        set.setDrawValues(false);
        return set;
    }
 
开发者ID:Alex-ZHOU,项目名称:VMAndroid,代码行数:17,代码来源:StoreDbRecordFragment.java

示例9: createSet

import com.github.mikephil.charting.data.LineDataSet; //导入方法依赖的package包/类
private LineDataSet createSet() {

        LineDataSet set = new LineDataSet(null, "Dynamic Data");
        set.setAxisDependency(YAxis.AxisDependency.LEFT);
        set.setColor(ColorTemplate.getHoloBlue());
        set.setCircleColor(Color.WHITE);
        set.setLineWidth(2f);
        set.setCircleRadius(4f);
        set.setFillAlpha(65);
        set.setFillColor(ColorTemplate.getHoloBlue());
        set.setHighLightColor(Color.rgb(244, 117, 117));
        set.setValueTextColor(Color.WHITE);
        set.setValueTextSize(9f);
        set.setDrawValues(false);
        return set;
    }
 
开发者ID:MarcProe,项目名称:lp2go,代码行数:17,代码来源:ViewControllerScope.java

示例10: initWithDummyData

import com.github.mikephil.charting.data.LineDataSet; //导入方法依赖的package包/类
private void initWithDummyData() {
    ArrayList<String> xVals = new ArrayList<String>();
    for (int i = 0; i < 24; i++) {
        xVals.add((i) + ":00");
    }

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

    // create a dataset and give it a type (0)
    LineDataSet set1 = new LineDataSet(yVals, "DataSet");
    set1.setLineWidth(3f);
    set1.setCircleRadius(5f);

    ArrayList<ILineDataSet> dataSets = new ArrayList<ILineDataSet>();
    dataSets.add(set1); // add the datasets

    // create a data object with the datasets
    LineData data = new LineData(xVals, dataSets);

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

示例11: generateLineData

import com.github.mikephil.charting.data.LineDataSet; //导入方法依赖的package包/类
private LineData generateLineData() {

        LineData d = new LineData();

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

        for (int index = 0; index < itemcount; index++)
            entries.add(new Entry(index + 0.5f, getRandom(15, 5)));

        LineDataSet set = new LineDataSet(entries, "Line DataSet");
        set.setColor(Color.rgb(240, 238, 70));
        set.setLineWidth(2.5f);
        set.setCircleColor(Color.rgb(240, 238, 70));
        set.setCircleRadius(5f);
        set.setFillColor(Color.rgb(240, 238, 70));
        set.setMode(LineDataSet.Mode.CUBIC_BEZIER);
        set.setDrawValues(true);
        set.setValueTextSize(10f);
        set.setValueTextColor(Color.rgb(240, 238, 70));

        set.setAxisDependency(YAxis.AxisDependency.LEFT);
        d.addDataSet(set);

        return d;
    }
 
开发者ID:xsingHu,项目名称:xs-android-architecture,代码行数:26,代码来源:CombinedChartActivity.java

示例12: initWithDummyData

import com.github.mikephil.charting.data.LineDataSet; //导入方法依赖的package包/类
private void initWithDummyData() {

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

        // create a dataset and give it a type (0)
        LineDataSet set1 = new LineDataSet(yVals, "DataSet");
        set1.setLineWidth(3f);
        set1.setCircleRadius(5f);

        // create a data object with the datasets
        LineData data = new LineData(set1);

        mChart.setData(data);
    }
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:15,代码来源:DrawChartActivity.java

示例13: addDataSet

import com.github.mikephil.charting.data.LineDataSet; //导入方法依赖的package包/类
private void addDataSet() {

        LineData data = mChart.getData();

        if (data != null) {

            int count = (data.getDataSetCount() + 1);

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

            for (int i = 0; i < data.getEntryCount(); i++) {
                yVals.add(new Entry(i, (float) (Math.random() * 50f) + 50f * count));
            }

            LineDataSet set = new LineDataSet(yVals, "DataSet " + count);
            set.setLineWidth(2.5f);
            set.setCircleRadius(4.5f);

            int color = mColors[count % mColors.length];

            set.setColor(color);
            set.setCircleColor(color);
            set.setHighLightColor(color);
            set.setValueTextSize(10f);
            set.setValueTextColor(color);

            data.addDataSet(set);
            data.notifyDataChanged();
            mChart.notifyDataSetChanged();
            mChart.invalidate();
        }
    }
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:33,代码来源:DynamicalAddingActivity.java

示例14: getData

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

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

        for (int i = 0; i < count; i++) {
            float val = (float) (Math.random() * range) + 3;
            yVals.add(new Entry(i, val));
        }

        // create a dataset and give it a type
        LineDataSet set1 = new LineDataSet(yVals, "DataSet 1");
        // set1.setFillAlpha(110);
        // set1.setFillColor(Color.RED);

        set1.setLineWidth(1.75f);
        set1.setCircleRadius(5f);
        set1.setCircleHoleRadius(2.5f);
        set1.setColor(Color.WHITE);
        set1.setCircleColor(Color.WHITE);
        set1.setHighLightColor(Color.WHITE);
        set1.setDrawValues(false);

        // create a data object with the datasets
        LineData data = new LineData(set1);

        return data;
    }
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:28,代码来源:LineChartActivityColored.java

示例15: updateGraph

import com.github.mikephil.charting.data.LineDataSet; //导入方法依赖的package包/类
/**
 *
 */
private void updateGraph(List<Entry> entries) {
    LineDataSet dataSet = new LineDataSet(entries, "Label");

    dataSet.setDrawValues(false);
    dataSet.setLineWidth(2f);
    dataSet.setDrawCircles(true);
    dataSet.setDrawCircles(false);

    LineData lineData = new LineData(dataSet);
    _walletFragView.updateChartPriceData(lineData);
}
 
开发者ID:ehanoc,项目名称:xwallet,代码行数:15,代码来源:WalletFragment.java


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