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


Java IDataSet.setDrawValues方法代码示例

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


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

示例1: onOptionsItemSelected

import com.github.mikephil.charting.interfaces.datasets.IDataSet; //导入方法依赖的package包/类
@Override
public boolean onOptionsItemSelected(MenuItem item) {

    switch (item.getItemId()) {
        case R.id.actionToggleValues: {
            for (IDataSet<?> set : mChart.getData().getDataSets())
                set.setDrawValues(!set.isDrawValuesEnabled());

            mChart.invalidate();
            break;
        }
        case R.id.actionToggleHole: {
            if (mChart.isDrawHoleEnabled())
                mChart.setDrawHoleEnabled(false);
            else
                mChart.setDrawHoleEnabled(true);
            mChart.invalidate();
            break;
        }
        case R.id.actionDrawCenter: {
            if (mChart.isDrawCenterTextEnabled())
                mChart.setDrawCenterText(false);
            else
                mChart.setDrawCenterText(true);
            mChart.invalidate();
            break;
        }
        case R.id.actionToggleXVals: {

            mChart.setDrawEntryLabels(!mChart.isDrawEntryLabelsEnabled());
            mChart.invalidate();
            break;
        }
        case R.id.actionSave: {
            // mChart.saveToGallery("title"+System.currentTimeMillis());
            mChart.saveToPath("title" + System.currentTimeMillis(), "");
            break;
        }
        case R.id.actionTogglePercent:
            mChart.setUsePercentValues(!mChart.isUsePercentValuesEnabled());
            mChart.invalidate();
            break;
        case R.id.animateX: {
            mChart.animateX(1400);
            break;
        }
        case R.id.animateY: {
            mChart.animateY(1400);
            break;
        }
        case R.id.animateXY: {
            mChart.animateXY(1400, 1400);
            break;
        }
    }
    return true;
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:58,代码来源:PiePolylineChartActivity.java

示例2: onOptionsItemSelected

import com.github.mikephil.charting.interfaces.datasets.IDataSet; //导入方法依赖的package包/类
@Override
public boolean onOptionsItemSelected(MenuItem item) {

    switch (item.getItemId()) {
        case R.id.actionToggleValues: {
            for (IDataSet set : mChart.getData().getDataSets())
                set.setDrawValues(!set.isDrawValuesEnabled());

            mChart.invalidate();
            break;
        }
        case R.id.actionToggleHighlight: {
            if(mChart.getData() != null) {
                mChart.getData().setHighlightEnabled(!mChart.getData().isHighlightEnabled());
                mChart.invalidate();
            }
            break;
        }
        case R.id.actionTogglePinch: {
            if (mChart.isPinchZoomEnabled())
                mChart.setPinchZoom(false);
            else
                mChart.setPinchZoom(true);

            mChart.invalidate();
            break;
        }
        case R.id.actionToggleAutoScaleMinMax: {
            mChart.setAutoScaleMinMaxEnabled(!mChart.isAutoScaleMinMaxEnabled());
            mChart.notifyDataSetChanged();
            break;
        }
        case R.id.actionToggleHighlightArrow: {
            if (mChart.isDrawHighlightArrowEnabled())
                mChart.setDrawHighlightArrow(false);
            else
                mChart.setDrawHighlightArrow(true);
            mChart.invalidate();
            break;
        }
        case R.id.animateX: {
            mChart.animateX(3000);
            break;
        }
        case R.id.animateY: {
            mChart.animateY(3000);
            break;
        }
        case R.id.animateXY: {

            mChart.animateXY(3000, 3000);
            break;
        }
        case R.id.actionSave: {
            if (mChart.saveToGallery("title" + System.currentTimeMillis(), 50)) {
                Toast.makeText(getApplicationContext(), "Saving SUCCESSFUL!",
                        Toast.LENGTH_SHORT).show();
            } else
                Toast.makeText(getApplicationContext(), "Saving FAILED!", Toast.LENGTH_SHORT)
                        .show();
            break;
        }
    }
    return true;
}
 
开发者ID:rahulmaddineni,项目名称:Stayfit,代码行数:66,代码来源:BarChartActivity.java

示例3: onOptionsItemSelected

import com.github.mikephil.charting.interfaces.datasets.IDataSet; //导入方法依赖的package包/类
@Override
public boolean onOptionsItemSelected(MenuItem item) {

    switch (item.getItemId()) {
        case R.id.actionToggleValues: {
            for (IDataSet set : mChart.getData().getDataSets())
                set.setDrawValues(!set.isDrawValuesEnabled());

            mChart.invalidate();
            break;
        }
        case R.id.actionToggleHighlight: {
            if(mChart.getData() != null) {
                mChart.getData().setHighlightEnabled(!mChart.getData().isHighlightEnabled());
                mChart.invalidate();
            }
            break;
        }
        case R.id.actionTogglePinch: {
            if (mChart.isPinchZoomEnabled())
                mChart.setPinchZoom(false);
            else
                mChart.setPinchZoom(true);

            mChart.invalidate();
            break;
        }
        case R.id.actionToggleAutoScaleMinMax: {
            mChart.setAutoScaleMinMaxEnabled(!mChart.isAutoScaleMinMaxEnabled());
            mChart.notifyDataSetChanged();
            break;
        }
        case R.id.actionSave: {
            // mChart.saveToGallery("title"+System.currentTimeMillis());
            mChart.saveToPath("title" + System.currentTimeMillis(), "");
            break;
        }
        case R.id.animateX: {
            mChart.animateX(3000);
            break;
        }
        case R.id.animateY: {
            mChart.animateY(3000);
            break;
        }
        case R.id.animateXY: {

            mChart.animateXY(3000, 3000);
            break;
        }
    }
    return true;
}
 
开发者ID:rahulmaddineni,项目名称:Stayfit,代码行数:54,代码来源:BubbleChartActivity.java

示例4: onOptionsItemSelected

import com.github.mikephil.charting.interfaces.datasets.IDataSet; //导入方法依赖的package包/类
@Override
public boolean onOptionsItemSelected(MenuItem item) {

    switch (item.getItemId()) {
        case R.id.actionToggleValues: {

            for (IDataSet set : mChart.getData().getDataSets())
                set.setDrawValues(!set.isDrawValuesEnabled());

            mChart.invalidate();
            break;
        }
        case R.id.actionToggleHighlight: {

            if(mChart.getData() != null) {
                mChart.getData().setHighlightEnabled(!mChart.getData().isHighlightEnabled());
                mChart.invalidate();
            }
            break;
        }
        case R.id.actionTogglePinch: {
            if (mChart.isPinchZoomEnabled())
                mChart.setPinchZoom(false);
            else
                mChart.setPinchZoom(true);

            mChart.invalidate();
            break;
        }
        case R.id.actionToggleAutoScaleMinMax: {
            mChart.setAutoScaleMinMaxEnabled(!mChart.isAutoScaleMinMaxEnabled());
            mChart.notifyDataSetChanged();
            break;
        }
        case R.id.actionToggleHighlightArrow: {
            if (mChart.isDrawHighlightArrowEnabled())
                mChart.setDrawHighlightArrow(false);
            else
                mChart.setDrawHighlightArrow(true);
            mChart.invalidate();
            break;
        }
        case R.id.animateX: {
            mChart.animateX(3000);
            break;
        }
        case R.id.animateY: {
            mChart.animateY(3000);
            break;
        }
        case R.id.animateXY: {

            mChart.animateXY(3000, 3000);
            break;
        }
        case R.id.actionSave: {
            if (mChart.saveToGallery("title" + System.currentTimeMillis(), 50)) {
                Toast.makeText(getApplicationContext(), "Saving SUCCESSFUL!",
                        Toast.LENGTH_SHORT).show();
            } else
                Toast.makeText(getApplicationContext(), "Saving FAILED!", Toast.LENGTH_SHORT)
                        .show();
            break;
        }
    }
    return true;
}
 
开发者ID:rahulmaddineni,项目名称:Stayfit,代码行数:68,代码来源:AnotherBarActivity.java

示例5: onOptionsItemSelected

import com.github.mikephil.charting.interfaces.datasets.IDataSet; //导入方法依赖的package包/类
@Override
public boolean onOptionsItemSelected(MenuItem item) {

    switch (item.getItemId()) {
        case R.id.actionToggleValues: {
            for (IDataSet<?> set : mChart.getData().getDataSets())
                set.setDrawValues(!set.isDrawValuesEnabled());

            mChart.invalidate();
            break;
        }
        case R.id.actionToggleHole: {
            if (mChart.isDrawHoleEnabled())
                mChart.setDrawHoleEnabled(false);
            else
                mChart.setDrawHoleEnabled(true);
            mChart.invalidate();
            break;
        }
        case R.id.actionDrawCenter: {
            if (mChart.isDrawCenterTextEnabled())
                mChart.setDrawCenterText(false);
            else
                mChart.setDrawCenterText(true);
            mChart.invalidate();
            break;
        }
        case R.id.actionToggleXVals: {

            mChart.setDrawSliceText(!mChart.isDrawSliceTextEnabled());
            mChart.invalidate();
            break;
        }
        case R.id.actionSave: {
            // mChart.saveToGallery("title"+System.currentTimeMillis());
            mChart.saveToPath("title" + System.currentTimeMillis(), "");
            break;
        }
        case R.id.actionTogglePercent:
            mChart.setUsePercentValues(!mChart.isUsePercentValuesEnabled());
            mChart.invalidate();
            break;
        case R.id.animateX: {
            mChart.animateX(1400);
            break;
        }
        case R.id.animateY: {
            mChart.animateY(1400);
            break;
        }
        case R.id.animateXY: {
            mChart.animateXY(1400, 1400);
            break;
        }
    }
    return true;
}
 
开发者ID:rahulmaddineni,项目名称:Stayfit,代码行数:58,代码来源:PieChartActivity.java

示例6: onOptionsItemSelected

import com.github.mikephil.charting.interfaces.datasets.IDataSet; //导入方法依赖的package包/类
@Override
public boolean onOptionsItemSelected(MenuItem item) {

    switch (item.getItemId()) {
        case R.id.actionToggleValues: {
            for (IDataSet set : mChart.getData().getDataSets())
                set.setDrawValues(!set.isDrawValuesEnabled());

            mChart.invalidate();
            break;
        }
        case R.id.actionToggleHighlight: {
            if(mChart.getData() != null) {
                mChart.getData().setHighlightEnabled(!mChart.getData().isHighlightEnabled());
                mChart.invalidate();
            }
            break;
        }
        case R.id.actionTogglePinch: {
            if (mChart.isPinchZoomEnabled())
                mChart.setPinchZoom(false);
            else
                mChart.setPinchZoom(true);

            mChart.invalidate();
            break;
        }
        case R.id.actionToggleAutoScaleMinMax: {
            mChart.setAutoScaleMinMaxEnabled(!mChart.isAutoScaleMinMaxEnabled());
            mChart.notifyDataSetChanged();
            break;
        }
        case R.id.actionSave: {
            mChart.saveToPath("title" + System.currentTimeMillis(), "");
            break;
        }
        case R.id.animateX: {
            mChart.animateX(3000);
            break;
        }
        case R.id.animateY: {
            mChart.animateY(3000);
            break;
        }
        case R.id.animateXY: {

            mChart.animateXY(3000, 3000);
            break;
        }
    }
    return true;
}
 
开发者ID:xsingHu,项目名称:xs-android-architecture,代码行数:53,代码来源:BubbleChartActivity.java

示例7: onOptionsItemSelected

import com.github.mikephil.charting.interfaces.datasets.IDataSet; //导入方法依赖的package包/类
@Override
public boolean onOptionsItemSelected(MenuItem item) {

    switch (item.getItemId()) {
        case R.id.actionToggleValues: {
            for (IDataSet<?> set : mChart.getData().getDataSets())
                set.setDrawValues(!set.isDrawValuesEnabled());

            mChart.invalidate();
            break;
        }
        case R.id.actionToggleHole: {
            if (mChart.isDrawHoleEnabled())
                mChart.setDrawHoleEnabled(false);
            else
                mChart.setDrawHoleEnabled(true);
            mChart.invalidate();
            break;
        }
        case R.id.actionDrawCenter: {
            if (mChart.isDrawCenterTextEnabled())
                mChart.setDrawCenterText(false);
            else
                mChart.setDrawCenterText(true);
            mChart.invalidate();
            break;
        }
        case R.id.actionToggleXVals: {

            mChart.setDrawEntryLabels(!mChart.isDrawEntryLabelsEnabled());
            mChart.invalidate();
            break;
        }
        case R.id.actionSave: {
            // mChart.saveToGallery("title"+System.currentTimeMillis());
            mChart.saveToPath("title" + System.currentTimeMillis(), "");
            break;
        }
        case R.id.actionTogglePercent:
            mChart.setUsePercentValues(!mChart.isUsePercentValuesEnabled());
            mChart.invalidate();
            break;
        case R.id.animateX: {
            mChart.animateX(1400);
            break;
        }
        case R.id.animateY: {
            mChart.animateY(1400);
            break;
        }
        case R.id.animateXY: {
            mChart.animateXY(1400, 1400);
            break;
        }
        case R.id.actionToggleSpin: {
            mChart.spin(1000, mChart.getRotationAngle(), mChart.getRotationAngle() + 360, Easing.EasingOption
                    .EaseInCubic);
            break;
        }
    }
    return true;
}
 
开发者ID:xsingHu,项目名称:xs-android-architecture,代码行数:63,代码来源:PieChartActivity.java

示例8: setDrawValues

import com.github.mikephil.charting.interfaces.datasets.IDataSet; //导入方法依赖的package包/类
/**
 * Enables / disables drawing values (value-text) for all DataSets this data
 * object contains.
 *
 * @param enabled
 */
public void setDrawValues(boolean enabled) {
    for (IDataSet set : mDataSets) {
        set.setDrawValues(enabled);
    }
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:12,代码来源:ChartData.java


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