本文整理匯總了Java中com.github.mikephil.charting.data.LineDataSet.setCircleSize方法的典型用法代碼示例。如果您正苦於以下問題:Java LineDataSet.setCircleSize方法的具體用法?Java LineDataSet.setCircleSize怎麽用?Java LineDataSet.setCircleSize使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類com.github.mikephil.charting.data.LineDataSet
的用法示例。
在下文中一共展示了LineDataSet.setCircleSize方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: clearChart
import com.github.mikephil.charting.data.LineDataSet; //導入方法依賴的package包/類
public void clearChart() {
List<Entry> mLineDataSetEntries = new ArrayList<>();
LineDataSet mLineDataSet = new LineDataSet(mLineDataSetEntries, "");
mLineDataSet.setLineWidth(2f);
mLineDataSet.setCircleSize(0f);
mLineDataSet.addEntry(new Entry(0f, 0));
mLineDataSet.setDrawValues(false);
mTicks = new ArrayList<>();
mTicks.add("0");
List<LineDataSet> list = new ArrayList<>();
list.add(mLineDataSet);
LineData mLineData = new LineData(mTicks, list);
mChart.setData(mLineData);
}
示例2: generateDataLine
import com.github.mikephil.charting.data.LineDataSet; //導入方法依賴的package包/類
/**
* generates a random ChartData object with just one DataSet
*
* @return
*/
private LineData generateDataLine() {
ArrayList<Entry> e1 = new ArrayList<Entry>();
// 定義y軸顯示的數據(隨機生成),真實項目數據來自服務器
for (int i = 0; i < 12; i++) {
e1.add(new Entry((int) (Math.random() * 65) + 40, i));
}
// 獲取折線1的數據集
LineDataSet d1 = new LineDataSet(e1, "New DataSet 1");
// 設置折線的寬度
d1.setLineWidth(2.5f);
// 設置圓圈的半徑
d1.setCircleSize(4.5f);
// 設置選中圓圈時x,y軸線高亮的顏色
d1.setHighLightColor(Color.rgb(244, 117, 117));
// 設置小圓圈是否顯示數據
d1.setDrawValues(false);
ArrayList<LineDataSet> sets = new ArrayList<LineDataSet>();
sets.add(d1);
LineData cd = new LineData(getMonths(), sets);
return cd;
}
示例3: getData
import com.github.mikephil.charting.data.LineDataSet; //導入方法依賴的package包/類
@Override @WorkerThread
protected LineData getData(final List<Sensor> sensors, final List<Measurement> measurementList) {
if (measurementList.size() == 0) {
return null;
}
ArrayList<String> xVals = new ArrayList<>();
ArrayList<Entry> yVals = new ArrayList<>();
for (int i = 0; i < measurementList.size(); ++i) {
final Measurement m = measurementList.get(i);
final String x = dateFormat.format(m.getTimestamp());
xVals.add(x);
try {
float y = format.parse(String.valueOf(m.getValue())).floatValue();
yVals.add(new Entry(y, i));
} catch (ParseException e) {
e.printStackTrace();
}
}
LineDataSet dataSet = new LineDataSet(yVals, item.getTitle());
dataSet.setLineWidth(3f);
dataSet.setCircleSize(3f);
dataSet.setColor(getResources().getColor(R.color.supporting_color_light_purple));
dataSet.setCircleColor(getResources().getColor(R.color.supporting_color_dark_purple));
dataSet.setHighLightColor(getResources().getColor(R.color.supporting_color_light_purple));
dataSet.setDrawValues(false);
dataSet.setDrawCubic(true);
ArrayList<LineDataSet> dataSets = new ArrayList<>();
dataSets.add(dataSet);
return new LineData(xVals, dataSets);
}
示例4: generateLineDataSet
import com.github.mikephil.charting.data.LineDataSet; //導入方法依賴的package包/類
private LineDataSet generateLineDataSet(List<Entry> yVals, int color) {
// create a dataset and give it a type
LineDataSet set1 = new LineDataSet(yVals, "");
List<Integer> colors = new ArrayList<>();
if (color == getResources().getColor(R.color.glucosio_pink)) {
for (Entry yVal : yVals) {
if (yVal.getVal() == (0)) {
colors.add(Color.TRANSPARENT);
} else {
colors.add(color);
}
}
set1.setCircleColors(colors);
} else {
set1.setCircleColor(color);
}
set1.setColor(color);
set1.setLineWidth(2f);
set1.setCircleSize(4f);
set1.setDrawCircleHole(true);
set1.disableDashedLine();
set1.setFillAlpha(255);
set1.setDrawFilled(true);
set1.setValueTextSize(0);
set1.setValueTextColor(Color.parseColor("#FFFFFF"));
set1.setFillDrawable(getResources().getDrawable(R.drawable.graph_gradient));
set1.setHighLightColor(getResources().getColor(R.color.glucosio_gray_light));
set1.setCubicIntensity(0.2f);
// TODO: Change this to true when a fix is available
// https://github.com/PhilJay/MPAndroidChart/issues/1541
set1.setDrawCubic(false);
if (Build.VERSION.SDK_INT <= Build.VERSION_CODES.JELLY_BEAN_MR2) {
set1.setDrawFilled(false);
set1.setLineWidth(2f);
set1.setCircleSize(4f);
set1.setDrawCircleHole(true);
}
return set1;
}