当前位置: 首页>>代码示例>>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;未经允许,请勿转载。