本文整理汇总了Java中com.github.mikephil.charting.interfaces.datasets.IDataSet.setValueFormatter方法的典型用法代码示例。如果您正苦于以下问题:Java IDataSet.setValueFormatter方法的具体用法?Java IDataSet.setValueFormatter怎么用?Java IDataSet.setValueFormatter使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.github.mikephil.charting.interfaces.datasets.IDataSet
的用法示例。
在下文中一共展示了IDataSet.setValueFormatter方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setData
import com.github.mikephil.charting.interfaces.datasets.IDataSet; //导入方法依赖的package包/类
/**
* Sets a new data object for the chart. The data object contains all values
* and information needed for displaying.
*
* @param data
*/
public void setData(T data) {
mData = data;
mOffsetsCalculated = false;
if (data == null) {
return;
}
// calculate how many digits are needed
setupDefaultFormatter(data.getYMin(), data.getYMax());
for (IDataSet set : mData.getDataSets()) {
if (set.needsFormatter() || set.getValueFormatter() == mDefaultValueFormatter)
set.setValueFormatter(mDefaultValueFormatter);
}
// let the chart know there is new data
notifyDataSetChanged();
if (mLogEnabled)
Log.i(LOG_TAG, "Data is set.");
}
示例2: setValueFormatter
import com.github.mikephil.charting.interfaces.datasets.IDataSet; //导入方法依赖的package包/类
/**
* Sets a custom IValueFormatter for all DataSets this data object contains.
*
* @param f
*/
public void setValueFormatter(IValueFormatter f) {
if (f == null)
return;
else {
for (IDataSet set : mDataSets) {
set.setValueFormatter(f);
}
}
}
示例3: setData
import com.github.mikephil.charting.interfaces.datasets.IDataSet; //导入方法依赖的package包/类
/**
* Sets a new data object for the chart. The data object contains all values
* and information needed for displaying.
*
* @param data
*/
public void setData(T data) {
if (data == null) {
Log.e(LOG_TAG,
"Cannot set data for chart. Provided data object is null.");
return;
}
// LET THE CHART KNOW THERE IS DATA
mOffsetsCalculated = false;
mData = data;
// calculate how many digits are needed
calculateFormatter(data.getYMin(), data.getYMax());
for (IDataSet set : mData.getDataSets()) {
if (Utils.needsDefaultFormatter(set.getValueFormatter()))
set.setValueFormatter(mDefaultFormatter);
}
// let the chart know there is new data
notifyDataSetChanged();
if (mLogEnabled)
Log.i(LOG_TAG, "Data is set.");
}
示例4: setValueFormatter
import com.github.mikephil.charting.interfaces.datasets.IDataSet; //导入方法依赖的package包/类
/**
* Sets a custom ValueFormatter for all DataSets this data object contains.
*
* @param f
*/
public void setValueFormatter(ValueFormatter f) {
if (f == null)
return;
else {
for (IDataSet set : mDataSets) {
set.setValueFormatter(f);
}
}
}