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


Java LineData.notifyDataChanged方法代码示例

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


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

示例1: removeLastEntry

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

        LineData data = mChart.getData();

        if (data != null) {

            ILineDataSet set = data.getDataSetByIndex(0);

            if (set != null) {

                Entry e = set.getEntryForXValue(set.getEntryCount() - 1, Float.NaN);

                data.removeEntry(e, 0);
                // or remove by index
                // mData.removeEntryByXValue(xIndex, dataSetIndex);
                data.notifyDataChanged();
                mChart.notifyDataSetChanged();
                mChart.invalidate();
            }
        }
    }
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:22,代码来源:DynamicalAddingActivity.java

示例2: update

import com.github.mikephil.charting.data.LineData; //导入方法依赖的package包/类
@Override
public void update(ParticulateMatterSample sample) {
    if (!ready) {
        return;
    }
    LineData data = chart.getData();

    addEntry(pm1Label, sample.getPm1_0());
    addEntry(pm25Label, sample.getPm2_5());
    addEntry(pm10Label, sample.getPm10());

    data.notifyDataChanged();

    // let the chart know it's data has changed
    chart.notifyDataSetChanged();

    // limit the number of visible entries
    chart.setVisibleXRangeMaximum(120);

    // move to the latest entry
    chart.moveViewToX(data.getEntryCount());
}
 
开发者ID:rjaros87,项目名称:pm-home-station,代码行数:23,代码来源:ChartFragment.java

示例3: addEntry

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

        LineData data = mLineChart.getData();

        if (data != null) {

            ILineDataSet set = data.getDataSetByIndex(0);
            // set.addEntry(...); // can be called as well

            if (set == null) {
                set = createSet();
                data.addDataSet(set);
            }

            data.addEntry(new Entry(set.getEntryCount(), db), 0);
            data.notifyDataChanged();

            // let the chart know it's data has changed
            mLineChart.notifyDataSetChanged();

            // limit the number of visible entries
            mLineChart.setVisibleXRangeMaximum(60);
            //mLineChart.setVisibleYRange(30, AxisDependency.LEFT);

            // move to the latest entry
            mLineChart.moveViewToX(data.getEntryCount());

        }
    }
 
开发者ID:Alex-ZHOU,项目名称:VMAndroid,代码行数:30,代码来源:RecordDBFragment.java

示例4: updateChart

import com.github.mikephil.charting.data.LineData; //导入方法依赖的package包/类
public void updateChart(float value, int index) {
  LineData data = messagesChart.getData();
  ILineDataSet set = data.getDataSetByIndex(index);

  if (set == null) {
    set = createSet(getLineColor(index));
    data.addDataSet(set);
  }

  data.addEntry(new Entry(set.getEntryCount(), value), index);
  data.notifyDataChanged();

  messagesChart.notifyDataSetChanged();
  messagesChart.setVisibleXRangeMaximum(getVisibleRange().getRange());
  messagesChart.moveViewToX(data.getEntryCount());
}
 
开发者ID:tommus,项目名称:rabbitmq-management-android,代码行数:17,代码来源:MessagesIndicator.java

示例5: pulse

import com.github.mikephil.charting.data.LineData; //导入方法依赖的package包/类
/**
 * Called in the UI thread.
 */
private void pulse() {
    addEntries();

    LineData historyData = (LineData) mStepsPerMinuteHistoryChart.getData();
    if (historyData == null) {
        return;
    }

    historyData.notifyDataChanged();
    mTotalStepsData.notifyDataSetChanged();
    mStepsPerMinuteData.notifyDataSetChanged();
    mStepsPerMinuteHistoryChart.notifyDataSetChanged();

    renderCharts();

    // have to enable it again and again to keep it measureing
    GBApplication.deviceService().onEnableRealtimeHeartRateMeasurement(true);
}
 
开发者ID:scifiswapnil,项目名称:gadgetbridge_artikcloud,代码行数:22,代码来源:LiveActivityFragment.java

示例6: addEntry

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

        LineData data = mChart.getData();

        ILineDataSet set = data.getDataSetByIndex(0);
        // set.addEntry(...); // can be called as well

        if (set == null) {
            set = createSet();
            data.addDataSet(set);
        }

        // choose a random dataSet
        int randomDataSetIndex = (int) (Math.random() * data.getDataSetCount());
        float yValue = (float) (Math.random() * 10) + 50f;

        data.addEntry(new Entry(data.getDataSetByIndex(randomDataSetIndex).getEntryCount(), yValue), randomDataSetIndex);
        data.notifyDataChanged();

        // let the chart know it's data has changed
        mChart.notifyDataSetChanged();

        mChart.setVisibleXRangeMaximum(6);
        //mChart.setVisibleYRangeMaximum(15, AxisDependency.LEFT);
//            
//            // this automatically refreshes the chart (calls invalidate())
        mChart.moveViewTo(data.getEntryCount() - 7, 50f, AxisDependency.LEFT);

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

示例7: addDataSet

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

示例8: addEntry

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

        LineData data = mChart.getData();

        if (data != null) {

            ILineDataSet set = data.getDataSetByIndex(0);
            // set.addEntry(...); // can be called as well

            if (set == null) {
                set = createSet();
                data.addDataSet(set);
            }

            data.addEntry(new Entry(set.getEntryCount(), (float) (Math.random() * 40) + 30f), 0);
            data.notifyDataChanged();

            // let the chart know it's data has changed
            mChart.notifyDataSetChanged();

            // limit the number of visible entries
            mChart.setVisibleXRangeMaximum(120);
            // mChart.setVisibleYRange(30, AxisDependency.LEFT);

            // move to the latest entry
            mChart.moveViewToX(data.getEntryCount());

            // this automatically refreshes the chart (calls invalidate())
            // mChart.moveViewTo(data.getXValCount()-7, 55f,
            // AxisDependency.LEFT);
        }
    }
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:33,代码来源:RealtimeLineChartActivity.java


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