本文整理汇总了Java中com.github.mikephil.charting.formatter.IFillFormatter类的典型用法代码示例。如果您正苦于以下问题:Java IFillFormatter类的具体用法?Java IFillFormatter怎么用?Java IFillFormatter使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
IFillFormatter类属于com.github.mikephil.charting.formatter包,在下文中一共展示了IFillFormatter类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getData
import com.github.mikephil.charting.formatter.IFillFormatter; //导入依赖的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;
}
示例2: setFillFormatter
import com.github.mikephil.charting.formatter.IFillFormatter; //导入依赖的package包/类
/**
* Sets a custom IFillFormatter to the chart that handles the position of the
* filled-line for each DataSet. Set this to null to use the default logic.
*
* @param formatter
*/
public void setFillFormatter(IFillFormatter formatter) {
if (formatter == null)
mFillFormatter = new DefaultFillFormatter();
else
mFillFormatter = formatter;
}
示例3: buildEMULayers
import com.github.mikephil.charting.formatter.IFillFormatter; //导入依赖的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;
}
示例4: setFillFormatter
import com.github.mikephil.charting.formatter.IFillFormatter; //导入依赖的package包/类
/**
* Sets a custom FillFormatter to the chart that handles the position of the
* filled-line for each DataSet. Set this to null to use the default logic.
*
* @param formatter
*/
public void setFillFormatter(IFillFormatter formatter) {
if (formatter == null)
mFillFormatter = new DefaultFillFormatter();
else
mFillFormatter = formatter;
}
示例5: getFillFormatter
import com.github.mikephil.charting.formatter.IFillFormatter; //导入依赖的package包/类
@Override
public IFillFormatter getFillFormatter() {
return mFillFormatter;
}
示例6: setData
import com.github.mikephil.charting.formatter.IFillFormatter; //导入依赖的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);
}
}
示例7: getFillFormatter
import com.github.mikephil.charting.formatter.IFillFormatter; //导入依赖的package包/类
/**
* Returns the IFillFormatter that is set for this DataSet.
*
* @return
*/
IFillFormatter getFillFormatter();