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


Java LineDataSet.setCircleSize方法代碼示例

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


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

示例1: clearChart

import com.github.mikephil.charting.data.LineDataSet; //導入方法依賴的package包/類
public void clearChart() {
    List<Entry> mLineDataSetEntries = new ArrayList<>();
    LineDataSet mLineDataSet = new LineDataSet(mLineDataSetEntries, "");
    mLineDataSet.setLineWidth(2f);
    mLineDataSet.setCircleSize(0f);
    mLineDataSet.addEntry(new Entry(0f, 0));
    mLineDataSet.setDrawValues(false);
    mTicks = new ArrayList<>();
    mTicks.add("0");
    List<LineDataSet> list = new ArrayList<>();
    list.add(mLineDataSet);
    LineData mLineData = new LineData(mTicks, list);
    mChart.setData(mLineData);
}
 
開發者ID:mrprona92,項目名稱:SecretBrand,代碼行數:15,代碼來源:Graphs.java

示例2: generateDataLine

import com.github.mikephil.charting.data.LineDataSet; //導入方法依賴的package包/類
/**
 * generates a random ChartData object with just one DataSet
 *
 * @return
 */
private LineData generateDataLine() {

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

    // 定義y軸顯示的數據(隨機生成),真實項目數據來自服務器
    for (int i = 0; i < 12; i++) {
        e1.add(new Entry((int) (Math.random() * 65) + 40, i));
    }

    // 獲取折線1的數據集
    LineDataSet d1 = new LineDataSet(e1, "New DataSet 1");
    // 設置折線的寬度
    d1.setLineWidth(2.5f);
    // 設置圓圈的半徑
    d1.setCircleSize(4.5f);
    // 設置選中圓圈時x,y軸線高亮的顏色
    d1.setHighLightColor(Color.rgb(244, 117, 117));
    // 設置小圓圈是否顯示數據
    d1.setDrawValues(false);

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

    LineData cd = new LineData(getMonths(), sets);
    return cd;
}
 
開發者ID:xinpengfei520,項目名稱:P2P,代碼行數:32,代碼來源:LineChartActivity.java

示例3: getData

import com.github.mikephil.charting.data.LineDataSet; //導入方法依賴的package包/類
@Override @WorkerThread
protected LineData getData(final List<Sensor> sensors, final List<Measurement> measurementList) {

  if (measurementList.size() == 0) {
    return null;
  }
  ArrayList<String> xVals = new ArrayList<>();
  ArrayList<Entry> yVals = new ArrayList<>();
  for (int i = 0; i < measurementList.size(); ++i) {
    final Measurement m = measurementList.get(i);
    final String x = dateFormat.format(m.getTimestamp());
    xVals.add(x);
    try {
      float y = format.parse(String.valueOf(m.getValue())).floatValue();
      yVals.add(new Entry(y, i));
    } catch (ParseException e) {
      e.printStackTrace();
    }
  }

  LineDataSet dataSet = new LineDataSet(yVals, item.getTitle());

  dataSet.setLineWidth(3f);
  dataSet.setCircleSize(3f);
  dataSet.setColor(getResources().getColor(R.color.supporting_color_light_purple));
  dataSet.setCircleColor(getResources().getColor(R.color.supporting_color_dark_purple));
  dataSet.setHighLightColor(getResources().getColor(R.color.supporting_color_light_purple));
  dataSet.setDrawValues(false);
  dataSet.setDrawCubic(true);


  ArrayList<LineDataSet> dataSets = new ArrayList<>();
  dataSets.add(dataSet);

  return new LineData(xVals, dataSets);
}
 
開發者ID:CreatorDev,項目名稱:android-temperature-logger,代碼行數:37,代碼來源:DetailsFragment.java

示例4: generateLineDataSet

import com.github.mikephil.charting.data.LineDataSet; //導入方法依賴的package包/類
private LineDataSet generateLineDataSet(List<Entry> yVals, int color) {
    // create a dataset and give it a type
    LineDataSet set1 = new LineDataSet(yVals, "");
    List<Integer> colors = new ArrayList<>();

    if (color == getResources().getColor(R.color.glucosio_pink)) {
        for (Entry yVal : yVals) {
            if (yVal.getVal() == (0)) {
                colors.add(Color.TRANSPARENT);
            } else {
                colors.add(color);
            }
        }
        set1.setCircleColors(colors);
    } else {
        set1.setCircleColor(color);
    }

    set1.setColor(color);
    set1.setLineWidth(2f);
    set1.setCircleSize(4f);
    set1.setDrawCircleHole(true);
    set1.disableDashedLine();
    set1.setFillAlpha(255);
    set1.setDrawFilled(true);
    set1.setValueTextSize(0);
    set1.setValueTextColor(Color.parseColor("#FFFFFF"));
    set1.setFillDrawable(getResources().getDrawable(R.drawable.graph_gradient));
    set1.setHighLightColor(getResources().getColor(R.color.glucosio_gray_light));
    set1.setCubicIntensity(0.2f);

    // TODO: Change this to true when a fix is available
    // https://github.com/PhilJay/MPAndroidChart/issues/1541
    set1.setDrawCubic(false);

    if (Build.VERSION.SDK_INT <= Build.VERSION_CODES.JELLY_BEAN_MR2) {
        set1.setDrawFilled(false);
        set1.setLineWidth(2f);
        set1.setCircleSize(4f);
        set1.setDrawCircleHole(true);
    }

    return set1;
}
 
開發者ID:adithya321,項目名稱:SOS-The-Healthcare-Companion,代碼行數:45,代碼來源:OverviewFragment.java


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