本文整理汇总了Java中com.github.mikephil.charting.data.ScatterData.addDataSet方法的典型用法代码示例。如果您正苦于以下问题:Java ScatterData.addDataSet方法的具体用法?Java ScatterData.addDataSet怎么用?Java ScatterData.addDataSet使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.github.mikephil.charting.data.ScatterData
的用法示例。
在下文中一共展示了ScatterData.addDataSet方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: generateScatterData
import com.github.mikephil.charting.data.ScatterData; //导入方法依赖的package包/类
protected ScatterData generateScatterData() {
ScatterData d = new ScatterData();
ArrayList<Entry> entries = new ArrayList<Entry>();
for (float index = 0; index < itemcount; index += 0.5f)
entries.add(new Entry(index + 0.25f, getRandom(10, 55)));
ScatterDataSet set = new ScatterDataSet(entries, "Scatter DataSet");
set.setColors(ColorTemplate.MATERIAL_COLORS);
set.setScatterShapeSize(7.5f);
set.setDrawValues(false);
set.setValueTextSize(10f);
d.addDataSet(set);
return d;
}
示例2: generateScatterData
import com.github.mikephil.charting.data.ScatterData; //导入方法依赖的package包/类
protected ScatterData generateScatterData() {
ScatterData d = new ScatterData();
ArrayList<Entry> entries = new ArrayList<Entry>();
for (int index = 0; index < itemcount; index++)
entries.add(new Entry(getRandom(20, 15), index));
ScatterDataSet set = new ScatterDataSet(entries, "Scatter DataSet");
set.setColor(Color.GREEN);
set.setScatterShapeSize(7.5f);
set.setDrawValues(false);
set.setValueTextSize(10f);
d.addDataSet(set);
return d;
}
示例3: generateScatterData
import com.github.mikephil.charting.data.ScatterData; //导入方法依赖的package包/类
/**
* Prepare ScatterData object
* @param averageValue
* @param seriesName
* @return ScatterData
*/
private ScatterData generateScatterData(float averageValue, String seriesName){
ScatterData d = new ScatterData();
ArrayList<Entry> entries = new ArrayList<>();
entries.add(new Entry(1.5f, averageValue));
ScatterDataSet set = new ScatterDataSet(entries, seriesName);
set.setColor(Color.parseColor("#FF4081"));
set.setScatterShape(ScatterChart.ScatterShape.SQUARE);
set.setScatterShapeSize(15f);
set.setDrawValues(false);
set.setValueTextSize(10f);
d.addDataSet(set);
return d;
}