當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。