當前位置: 首頁>>代碼示例>>Java>>正文


Java LineDataSet.setFillColor方法代碼示例

本文整理匯總了Java中com.github.mikephil.charting.data.LineDataSet.setFillColor方法的典型用法代碼示例。如果您正苦於以下問題:Java LineDataSet.setFillColor方法的具體用法?Java LineDataSet.setFillColor怎麽用?Java LineDataSet.setFillColor使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在com.github.mikephil.charting.data.LineDataSet的用法示例。


在下文中一共展示了LineDataSet.setFillColor方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: 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:weiwenqiang,項目名稱:GitHub,代碼行數:26,代碼來源:CombinedChartActivity.java

示例2: 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

示例3: 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

示例4: 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,代碼來源:RecordDBFragment.java

示例5: 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(getRandom(15, 10), index));

        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.setDrawCubic(true);
        set.setDrawValues(true);
        set.setValueTextSize(10f);
        set.setValueTextColor(Color.rgb(240, 238, 70));

        set.setAxisDependency(YAxis.AxisDependency.LEFT);

        d.addDataSet(set);

        return d;
    }
 
開發者ID:rahulmaddineni,項目名稱:Stayfit,代碼行數:27,代碼來源:CombinedChartActivity.java

示例6: createSet

import com.github.mikephil.charting.data.LineDataSet; //導入方法依賴的package包/類
private LineDataSet createSet() {
    LineDataSet set = new LineDataSet(null, "BG Data");
    set.setAxisDependency(YAxis.AxisDependency.LEFT);
    set.setColor(ColorTemplate.getHoloBlue());
    set.setCircleColor(Color.WHITE);
    set.setLineWidth(2f);
    set.setCircleRadius(3f);
    set.setFillAlpha(65);
    set.setFillColor(ColorTemplate.getHoloBlue());
    set.setHighLightColor(Color.rgb(244, 117, 117));
    set.setValueTextColor(Color.WHITE);
    set.setValueTextSize(9f);
    set.setDrawValues(false);
    //set.setColors(ColorTemplate.COLORFUL_COLORS);
    //set.setColors(ColorTemplate.VORDIPLOM_COLORS);
    //set.setColors(ColorTemplate.JOYFUL_COLORS);
    //set.setColors(ColorTemplate.LIBERTY_COLORS);
    //set.setColors(ColorTemplate.PASTEL_COLORS);
    //set.setDrawCubic(chartcubic);
    return set;
}
 
開發者ID:LadyViktoria,項目名稱:wearDrip,代碼行數:22,代碼來源:wearDripWatchFace.java

示例7: getLineData

import com.github.mikephil.charting.data.LineDataSet; //導入方法依賴的package包/類
private LineData getLineData(List<String> xVals, List<Entry> lineEntries) {
    final LineDataSet dataSet = new LineDataSet(lineEntries, getContext().getString(R.string.moving_average));

    final int color = ContextCompat.getColor(getContext(), R.color.brown);

    dataSet.setColor(color);
    dataSet.setLineWidth(2.5f);
    dataSet.setCircleColor(color);
    dataSet.setFillColor(color);
    dataSet.setDrawValues(true);
    dataSet.setValueTextSize(12);
    dataSet.setValueTextColor(color);

    // Format the value labels to two decimal places
    dataSet.setValueFormatter(new LineChartValueFormatter());

    return new LineData(xVals, dataSet);
}
 
開發者ID:nutritionfactsorg,項目名稱:daily-dozen-android,代碼行數:19,代碼來源:LoadServingsHistoryTask.java

示例8: styleChartLines

import com.github.mikephil.charting.data.LineDataSet; //導入方法依賴的package包/類
/**
 * Style char lines (type, color, etc.).
 *
 * @param entries list of entries.
 * @return line data chart.
 */
private LineData styleChartLines(List<Entry> entries) {
    // Set styles
    LineDataSet lineDataSet = new LineDataSet(entries, "Recording");
    lineDataSet.setMode(LineDataSet.Mode.HORIZONTAL_BEZIER);
    lineDataSet.setCubicIntensity(0.2f);
    lineDataSet.setDrawValues(false);
    lineDataSet.setDrawCircles(false);
    lineDataSet.setLineWidth(1.8f);
    lineDataSet.setColor(ContextCompat.getColor(context, R.color.colorAccent));
    if (((int) lineDataSet.getYMax()) != 0) {
        lineDataSet.setDrawFilled(true);
        lineDataSet.setFillAlpha(255);
        // Fix bug with vectors in API < 21
        if (Build.VERSION.SDK_INT > Build.VERSION_CODES.KITKAT){
            Drawable drawable = ResourcesCompat.getDrawable(context.getResources(),
                    R.drawable.chart_fade, null);
            lineDataSet.setFillDrawable(drawable);
        } else{
            lineDataSet.setFillColor(ContextCompat.getColor(context, R.color.colorPrimary));
        }
    }
    return new LineData(lineDataSet);
}
 
開發者ID:davidmigloz,項目名稱:go-bees,代碼行數:30,代碼來源:RecordingsAdapter.java

示例9: 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 < 3; index++)
        entries.add(new Entry(index + 0.5f, UtilsRG.getRandomNumberInRange(0, 1)));

    LineDataSet set = new LineDataSet(entries, "Line DataSet");
    set.setColor(R.color.colorPrimaryLight);
    set.setLineWidth(2.5f);
    set.setCircleColor(R.color.colorPrimaryLight);
    set.setCircleRadius(5f);
    set.setFillColor(R.color.colorPrimaryLight);
    set.setMode(LineDataSet.Mode.CUBIC_BEZIER);
    set.setDrawValues(true);
    set.setValueTextSize(10f);
    set.setValueTextColor(R.color.colorPrimaryLight);

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

    return d;
}
 
開發者ID:lidox,項目名稱:reaction-test,代碼行數:25,代碼來源:BarChartView.java

示例10: 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

示例11: setData

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

        // now in hours
        long now = TimeUnit.MILLISECONDS.toHours(System.currentTimeMillis());

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

        float from = now;

        // count = hours
        float to = now + count;

        // increment by 1 hour
        for (float x = from; x < to; x++) {

            float y = getRandom(range, 50);
            values.add(new Entry(x, y)); // add one entry per hour
        }

        // create a dataset and give it a type
        LineDataSet set1 = new LineDataSet(values, "DataSet 1");
        set1.setAxisDependency(AxisDependency.LEFT);
        set1.setColor(ColorTemplate.getHoloBlue());
        set1.setValueTextColor(ColorTemplate.getHoloBlue());
        set1.setLineWidth(1.5f);
        set1.setDrawCircles(false);
        set1.setDrawValues(false);
        set1.setFillAlpha(65);
        set1.setFillColor(ColorTemplate.getHoloBlue());
        set1.setHighLightColor(Color.rgb(244, 117, 117));
        set1.setDrawCircleHole(false);

        // create a data object with the datasets
        LineData data = new LineData(set1);
        data.setValueTextColor(Color.WHITE);
        data.setValueTextSize(9f);

        // set data
        mChart.setData(data);
    }
 
開發者ID:weiwenqiang,項目名稱:GitHub,代碼行數:41,代碼來源:LineChartTime.java

示例12: setupDatasetWithDefaultValues

import com.github.mikephil.charting.data.LineDataSet; //導入方法依賴的package包/類
private void setupDatasetWithDefaultValues(LineDataSet dataSet) {
    dataSet.setAxisDependency(YAxis.AxisDependency.LEFT);
    dataSet.setColor(ColorTemplate.getHoloBlue());
    dataSet.setValueTextColor(ColorTemplate.getHoloBlue());
    dataSet.setLineWidth(1.5f);
    dataSet.setDrawCircles(false);
    dataSet.setDrawValues(false);
    dataSet.setFillAlpha(65);
    dataSet.setFillColor(ColorTemplate.getHoloBlue());
    dataSet.setHighLightColor(Color.rgb(244, 117, 117));
    dataSet.setDrawCircleHole(false);
}
 
開發者ID:ponewheel,項目名稱:android-ponewheel,代碼行數:13,代碼來源:RideDetailActivity.java

示例13: createSet

import com.github.mikephil.charting.data.LineDataSet; //導入方法依賴的package包/類
private LineDataSet createSet()
{
    LineDataSet set=new LineDataSet(null, "Data");
    set.setDrawCircles(true);
    set.setAxisDependency(YAxis.AxisDependency.LEFT);
    set.setColor(ColorTemplate.getHoloBlue());
    set.setCircleColor(ColorTemplate.getHoloBlue());
    set.setLineWidth(2f);
    set.setCircleRadius(4f);
    set.setFillAlpha(65);
    set.setFillColor(ColorTemplate.getHoloBlue());
    set.setHighLightColor(Color.rgb(244,117,177));
    return set;
}
 
開發者ID:S2606,項目名稱:HeartBeat,代碼行數:15,代碼來源:MainActivity.java

示例14: setData

import com.github.mikephil.charting.data.LineDataSet; //導入方法依賴的package包/類
private void setData() {
    List<Entry> entries = data.getList();

    for(Entry e: entries){
        Date d= new Date((long) e.getX());
        Log.d(Const.TAG2, "Next Entry is "+d.toString()+" , "+e.getY());
    }

    LineDataSet dataSet = new LineDataSet(entries, "Hourly Weather report");
    dataSet.setColor(Color.rgb(184, 235, 161));
    dataSet.setDrawCircleHole(false);
    dataSet.setCircleColor(Color.CYAN);
    dataSet.setValueTextColor(Color.WHITE);
    dataSet.setValueTextSize(15);
    dataSet.setDrawFilled(true);
    dataSet.setFillColor(Color.LTGRAY);
    dataSet.setDrawValues(true);
    dataSet.setMode(LineDataSet.Mode.CUBIC_BEZIER);
    dataSet.setValueFormatter(new IValueFormatter() {
        @Override
        public String getFormattedValue(float value, Entry entry, int dataSetIndex, ViewPortHandler viewPortHandler) {
            int newValue = (int) value;
            return newValue + Const.DEGREE;
        }
    });

    LineData lineData = new LineData(dataSet);

    lineChart.setData(lineData);
    lineChart.invalidate();//refresh
}
 
開發者ID:shivam301296,項目名稱:True-Weather,代碼行數:32,代碼來源:WeatherGraph.java

示例15: changeStyle

import com.github.mikephil.charting.data.LineDataSet; //導入方法依賴的package包/類
private void changeStyle(long id, LineChart chart, LineDataSet set) {
    final int index = (int) (id % FG.length);
    final Context context = chart.getContext();

    final int fg = ContextCompat.getColor(context, FG[index]);
    set.setColor(fg);
    set.setFillColor(fg);

    chart.setGridBackgroundColor(ContextCompat.getColor(context, BG[index]));
}
 
開發者ID:huazhouwang,項目名稱:Synapse,代碼行數:11,代碼來源:TrainedModelViewBinder.java


注:本文中的com.github.mikephil.charting.data.LineDataSet.setFillColor方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。