• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java LineDataProvider类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中com.github.mikephil.charting.interfaces.dataprovider.LineDataProvider的典型用法代码示例。如果您正苦于以下问题:Java LineDataProvider类的具体用法?Java LineDataProvider怎么用?Java LineDataProvider使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



LineDataProvider类属于com.github.mikephil.charting.interfaces.dataprovider包,在下文中一共展示了LineDataProvider类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: getData

import com.github.mikephil.charting.interfaces.dataprovider.LineDataProvider; //导入依赖的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


示例2: getFillLinePosition

import com.github.mikephil.charting.interfaces.dataprovider.LineDataProvider; //导入依赖的package包/类
@Override
public float getFillLinePosition(ILineDataSet dataSet, LineDataProvider dataProvider) {

    float fillMin = 0f;
    float chartMaxY = dataProvider.getYChartMax();
    float chartMinY = dataProvider.getYChartMin();

    LineData data = dataProvider.getLineData();

    if (dataSet.getYMax() > 0 && dataSet.getYMin() < 0) {
        fillMin = 0f;
    } else {

        float max, min;

        if (data.getYMax() > 0)
            max = 0f;
        else
            max = chartMaxY;
        if (data.getYMin() < 0)
            min = 0f;
        else
            min = chartMinY;

        fillMin = dataSet.getYMin() >= 0 ? min : max;
    }

    return fillMin;
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:30,代码来源:DefaultFillFormatter.java


示例3: LineChartRenderer

import com.github.mikephil.charting.interfaces.dataprovider.LineDataProvider; //导入依赖的package包/类
public LineChartRenderer(LineDataProvider chart, ChartAnimator animator,
                         ViewPortHandler viewPortHandler) {
    super(animator, viewPortHandler);
    mChart = chart;

    mCirclePaintInner = new Paint(Paint.ANTI_ALIAS_FLAG);
    mCirclePaintInner.setStyle(Paint.Style.FILL);
    mCirclePaintInner.setColor(Color.WHITE);
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:10,代码来源:LineChartRenderer.java


示例4: buildEMULayers

import com.github.mikephil.charting.interfaces.dataprovider.LineDataProvider; //导入依赖的package包/类
private LineData buildEMULayers(float xmin, float xmax){
  LineData data = new LineData();
  WaterColumn column = mDataManager.getCurrentWaterColumn();

  if (column != null){
    Set<EMUObservation> observations = column.getEmuSet();
    for (final EMUObservation observation : observations){
      ArrayList<Entry> entries = new ArrayList<>();

      for (float index = xmin; index <= xmax; index++) {
        entries.add(new Entry(index, Math.abs(observation.getTop())));
      }
      Collections.sort(entries, new EntryXComparator());

      LineDataSet set = new LineDataSet(entries, "Line DataSet");
      set.setAxisDependency(YAxis.AxisDependency.LEFT);
      set.setFillColor(Color.parseColor(EmuHelper.getColorForEMUCluster(observation.getEmu().getName())));

      set.setFillAlpha(255);
      set.setDrawCircles(false);
      set.setDrawValues(false);
      set.setDrawFilled(true);
      set.setHighLightColor(Color.rgb(244, 117, 117));
      set.setDrawCircleHole(false);
      set.setFillFormatter(new IFillFormatter() {
        @Override
        public float getFillLinePosition(ILineDataSet dataSet, LineDataProvider dataProvider) {
          return Math.abs(observation.getTop()) + observation.getThickness();
        }
      });
      data.addDataSet(set);
    }
  }else{
    Log.e(TAG, "Water column data object is null!");
  }


  return data;
}
 
开发者ID:Esri,项目名称:ecological-marine-unit-android,代码行数:40,代码来源:WaterProfilePresenter.java


示例5: getFillLinePosition

import com.github.mikephil.charting.interfaces.dataprovider.LineDataProvider; //导入依赖的package包/类
@Override
public float getFillLinePosition(ILineDataSet dataSet, LineDataProvider dataProvider) {
    // your logic could be here
    return mFillPos;
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:6,代码来源:MyFillFormatter.java


示例6: setData

import com.github.mikephil.charting.interfaces.dataprovider.LineDataProvider; //导入依赖的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


示例7: setData

import com.github.mikephil.charting.interfaces.dataprovider.LineDataProvider; //导入依赖的package包/类
private void setData(int count, float range) {

        ArrayList<Entry> yVals = 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);
            yVals.add(new Entry(i, val));
        }

        LineDataSet set1;

        if (mChart.getData() != null &&
                mChart.getData().getDataSetCount() > 0) {
            set1 = (LineDataSet)mChart.getData().getDataSetByIndex(0);
            set1.setValues(yVals);
            mChart.getData().notifyDataChanged();
            mChart.notifyDataSetChanged();
        } else {
            // create a dataset and give it a type
            set1 = new LineDataSet(yVals, "DataSet 1");

            set1.setMode(LineDataSet.Mode.CUBIC_BEZIER);
            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 IFillFormatter() {
                @Override
                public float getFillLinePosition(ILineDataSet dataSet, LineDataProvider dataProvider) {
                    return -10;
                }
            });

            // create a data object with the datasets
            LineData data = new LineData(set1);
            data.setValueTypeface(mTfLight);
            data.setValueTextSize(9f);
            data.setDrawValues(false);

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


示例8: CustomLineChartRenderer

import com.github.mikephil.charting.interfaces.dataprovider.LineDataProvider; //导入依赖的package包/类
public CustomLineChartRenderer(LineDataProvider chart, ChartAnimator animator, ViewPortHandler viewPortHandler) {
    super(chart, animator, viewPortHandler);
}
 
开发者ID:graham22,项目名称:Classic,代码行数:4,代码来源:CustomLineChartRenderer.java


示例9: getFillLinePosition

import com.github.mikephil.charting.interfaces.dataprovider.LineDataProvider; //导入依赖的package包/类
/**
 * Returns the vertical (y-axis) position where the filled-line of the
 * LineDataSet should end.
 * 
 * @param dataSet the ILineDataSet that is currently drawn
 * @param dataProvider
 * @return
 */
float getFillLinePosition(ILineDataSet dataSet, LineDataProvider dataProvider);
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:10,代码来源:IFillFormatter.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java EventNotificationDialog类代码示例发布时间:2022-05-22
下一篇:
Java MenuBuilder类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap