本文整理匯總了Java中com.github.mikephil.charting.data.LineDataSet.setDrawValues方法的典型用法代碼示例。如果您正苦於以下問題:Java LineDataSet.setDrawValues方法的具體用法?Java LineDataSet.setDrawValues怎麽用?Java LineDataSet.setDrawValues使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類com.github.mikephil.charting.data.LineDataSet
的用法示例。
在下文中一共展示了LineDataSet.setDrawValues方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: generateLineData
import com.github.mikephil.charting.data.LineDataSet; //導入方法依賴的package包/類
private LineData generateLineData() {
LineData d = new LineData();
ArrayList<Entry> entries = new ArrayList<Entry>();
for (int index = 0; index < itemcount; index++)
entries.add(new Entry(index + 0.5f, getRandom(15, 5)));
LineDataSet set = new LineDataSet(entries, "Line DataSet");
set.setColor(Color.rgb(240, 238, 70));
set.setLineWidth(2.5f);
set.setCircleColor(Color.rgb(240, 238, 70));
set.setCircleRadius(5f);
set.setFillColor(Color.rgb(240, 238, 70));
set.setMode(LineDataSet.Mode.CUBIC_BEZIER);
set.setDrawValues(true);
set.setValueTextSize(10f);
set.setValueTextColor(Color.rgb(240, 238, 70));
set.setAxisDependency(YAxis.AxisDependency.LEFT);
d.addDataSet(set);
return d;
}
示例2: createSet
import com.github.mikephil.charting.data.LineDataSet; //導入方法依賴的package包/類
private LineDataSet createSet() {
LineDataSet set = new LineDataSet(null, "Dynamic Data");
set.setAxisDependency(AxisDependency.LEFT);
set.setColor(ColorTemplate.getHoloBlue());
set.setCircleColor(Color.WHITE);
set.setLineWidth(2f);
set.setCircleRadius(4f);
set.setFillAlpha(65);
set.setFillColor(ColorTemplate.getHoloBlue());
set.setHighLightColor(Color.rgb(244, 117, 117));
set.setValueTextColor(Color.WHITE);
set.setValueTextSize(9f);
set.setDrawValues(false);
return set;
}
示例3: generateDataLine
import com.github.mikephil.charting.data.LineDataSet; //導入方法依賴的package包/類
/**
* generates a random ChartData object with just one DataSet
*
* @return
*/
private LineData generateDataLine(float[] datas, String type) {
ArrayList<Entry> entryList = new ArrayList<Entry>();
for (int i = 0; i < datas.length; i++) {
entryList.add(new Entry(i, datas[i]));
}
LineDataSet d1 = new LineDataSet(entryList, "DataSet :" + type);
d1.setLineWidth(2.5f);
Random r = new Random();
d1.setHighLightColor(Color.rgb(r.nextInt(256), r.nextInt(256), r.nextInt(256)));
d1.setDrawValues(false);
ArrayList<ILineDataSet> sets = new ArrayList<>();
sets.add(d1);
return new LineData(sets);
}
示例4: getData
import com.github.mikephil.charting.data.LineDataSet; //導入方法依賴的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;
}
示例5: createSet
import com.github.mikephil.charting.data.LineDataSet; //導入方法依賴的package包/類
private LineDataSet createSet(String label) {
LineDataSet set = new LineDataSet(null, label);
set.setAxisDependency(YAxis.AxisDependency.LEFT);
int color;
if (label.equals(pm1Label)) {
color = Color.BLUE;
} else if (label.equals(pm25Label)) {
color = Color.RED;
} else {
color = Color.BLACK;
}
set.setColor(color);
set.setLineWidth(2f);
set.setDrawValues(false);
set.setDrawCircles(false);
set.setMode(LineDataSet.Mode.LINEAR);
return set;
}
示例6: createSet
import com.github.mikephil.charting.data.LineDataSet; //導入方法依賴的package包/類
private LineDataSet createSet() {
LineDataSet set = new LineDataSet(null, getString(R.string.app_name));
set.setAxisDependency(YAxis.AxisDependency.LEFT);
set.setColor(ColorTemplate.getHoloBlue());
set.setCircleColor(Color.WHITE);
set.setLineWidth(1f);
set.setCircleRadius(1.5f);
set.setFillAlpha(65);
set.setFillColor(ColorTemplate.getHoloBlue());
set.setHighLightColor(Color.rgb(244, 117, 117));
set.setValueTextColor(Color.WHITE);
set.setValueTextSize(9f);
set.setDrawValues(false);
return set;
}
示例7: createSet
import com.github.mikephil.charting.data.LineDataSet; //導入方法依賴的package包/類
private LineDataSet createSet() {
LineDataSet set = new LineDataSet(null, "Dynamic Data");
set.setAxisDependency(YAxis.AxisDependency.LEFT);
set.setColor(ColorTemplate.getHoloBlue());
set.setCircleColor(Color.WHITE);
set.setLineWidth(2f);
set.setCircleRadius(4f);
set.setFillAlpha(65);
set.setFillColor(ColorTemplate.getHoloBlue());
set.setHighLightColor(Color.rgb(244, 117, 117));
set.setValueTextColor(Color.WHITE);
set.setValueTextSize(9f);
set.setDrawValues(false);
return set;
}
示例8: generateLineData
import com.github.mikephil.charting.data.LineDataSet; //導入方法依賴的package包/類
private LineData generateLineData() {
LineData d = new LineData();
ArrayList<Entry> entries = new ArrayList<Entry>();
for (int index = 0; index < 3; index++)
entries.add(new Entry(index + 0.5f, UtilsRG.getRandomNumberInRange(0, 1)));
LineDataSet set = new LineDataSet(entries, "Line DataSet");
set.setColor(R.color.colorPrimaryLight);
set.setLineWidth(2.5f);
set.setCircleColor(R.color.colorPrimaryLight);
set.setCircleRadius(5f);
set.setFillColor(R.color.colorPrimaryLight);
set.setMode(LineDataSet.Mode.CUBIC_BEZIER);
set.setDrawValues(true);
set.setValueTextSize(10f);
set.setValueTextColor(R.color.colorPrimaryLight);
set.setAxisDependency(YAxis.AxisDependency.LEFT);
d.addDataSet(set);
return d;
}
示例9: createSet
import com.github.mikephil.charting.data.LineDataSet; //導入方法依賴的package包/類
private LineDataSet createSet() {
LineDataSet set = new LineDataSet(null, "BG Data");
set.setAxisDependency(YAxis.AxisDependency.LEFT);
set.setColor(ColorTemplate.getHoloBlue());
set.setCircleColor(Color.WHITE);
set.setLineWidth(2f);
set.setCircleRadius(3f);
set.setFillAlpha(65);
set.setFillColor(ColorTemplate.getHoloBlue());
set.setHighLightColor(Color.rgb(244, 117, 117));
set.setValueTextColor(Color.WHITE);
set.setValueTextSize(9f);
set.setDrawValues(false);
//set.setColors(ColorTemplate.COLORFUL_COLORS);
//set.setColors(ColorTemplate.VORDIPLOM_COLORS);
//set.setColors(ColorTemplate.JOYFUL_COLORS);
//set.setColors(ColorTemplate.LIBERTY_COLORS);
//set.setColors(ColorTemplate.PASTEL_COLORS);
//set.setDrawCubic(chartcubic);
return set;
}
示例10: getData
import com.github.mikephil.charting.data.LineDataSet; //導入方法依賴的package包/類
private LineData getData(int count, float range) {
ArrayList<Entry> yVals = new ArrayList<Entry>();
for (int i = 0; i < count; i++) {
float val = (float) (Math.random() * range) + 3;
yVals.add(new Entry(i, val));
}
// create a dataset and give it a type
LineDataSet set1 = new LineDataSet(yVals, "DataSet 1");
// set1.setFillAlpha(110);
// set1.setFillColor(Color.RED);
set1.setLineWidth(1.75f);
set1.setCircleRadius(5f);
set1.setCircleHoleRadius(2.5f);
set1.setColor(Color.WHITE);
set1.setCircleColor(Color.WHITE);
set1.setHighLightColor(Color.WHITE);
set1.setDrawValues(false);
// create a data object with the datasets
LineData data = new LineData(set1);
return data;
}
示例11: setData
import com.github.mikephil.charting.data.LineDataSet; //導入方法依賴的package包/類
private void setData(int count, float range) {
// now in hours
long now = TimeUnit.MILLISECONDS.toHours(System.currentTimeMillis());
ArrayList<Entry> values = new ArrayList<Entry>();
float from = now;
// count = hours
float to = now + count;
// increment by 1 hour
for (float x = from; x < to; x++) {
float y = getRandom(range, 50);
values.add(new Entry(x, y)); // add one entry per hour
}
// create a dataset and give it a type
LineDataSet set1 = new LineDataSet(values, "DataSet 1");
set1.setAxisDependency(AxisDependency.LEFT);
set1.setColor(ColorTemplate.getHoloBlue());
set1.setValueTextColor(ColorTemplate.getHoloBlue());
set1.setLineWidth(1.5f);
set1.setDrawCircles(false);
set1.setDrawValues(false);
set1.setFillAlpha(65);
set1.setFillColor(ColorTemplate.getHoloBlue());
set1.setHighLightColor(Color.rgb(244, 117, 117));
set1.setDrawCircleHole(false);
// create a data object with the datasets
LineData data = new LineData(set1);
data.setValueTextColor(Color.WHITE);
data.setValueTextSize(9f);
// set data
mChart.setData(data);
}
示例12: generateDataLine
import com.github.mikephil.charting.data.LineDataSet; //導入方法依賴的package包/類
/**
* generates a random ChartData object with just one DataSet
*
* @return
*/
private LineData generateDataLine(int cnt) {
ArrayList<Entry> e1 = new ArrayList<Entry>();
for (int i = 0; i < 12; i++) {
e1.add(new Entry(i, (int) (Math.random() * 65) + 40));
}
LineDataSet d1 = new LineDataSet(e1, "New DataSet " + cnt + ", (1)");
d1.setLineWidth(2.5f);
d1.setCircleRadius(4.5f);
d1.setHighLightColor(Color.rgb(244, 117, 117));
d1.setDrawValues(false);
ArrayList<Entry> e2 = new ArrayList<Entry>();
for (int i = 0; i < 12; i++) {
e2.add(new Entry(i, e1.get(i).getY() - 30));
}
LineDataSet d2 = new LineDataSet(e2, "New DataSet " + cnt + ", (2)");
d2.setLineWidth(2.5f);
d2.setCircleRadius(4.5f);
d2.setHighLightColor(Color.rgb(244, 117, 117));
d2.setColor(ColorTemplate.VORDIPLOM_COLORS[0]);
d2.setCircleColor(ColorTemplate.VORDIPLOM_COLORS[0]);
d2.setDrawValues(false);
ArrayList<ILineDataSet> sets = new ArrayList<ILineDataSet>();
sets.add(d1);
sets.add(d2);
LineData cd = new LineData(sets);
return cd;
}
示例13: setData
import com.github.mikephil.charting.data.LineDataSet; //導入方法依賴的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) + 3;// + (float)
// ((mult *
// 0.1) / 10);
yVals.add(new Entry(i * 0.001f, val));
}
// create a dataset and give it a type
LineDataSet set1 = new LineDataSet(yVals, "DataSet 1");
set1.setColor(Color.BLACK);
set1.setLineWidth(0.5f);
set1.setDrawValues(false);
set1.setDrawCircles(false);
set1.setMode(LineDataSet.Mode.LINEAR);
set1.setDrawFilled(false);
// create a data object with the datasets
LineData data = new LineData(set1);
// set data
mChart.setData(data);
// get the legend (only possible after setting data)
Legend l = mChart.getLegend();
l.setEnabled(false);
}
示例14: setupDatasetWithDefaultValues
import com.github.mikephil.charting.data.LineDataSet; //導入方法依賴的package包/類
private void setupDatasetWithDefaultValues(LineDataSet dataSet) {
dataSet.setAxisDependency(YAxis.AxisDependency.LEFT);
dataSet.setColor(ColorTemplate.getHoloBlue());
dataSet.setValueTextColor(ColorTemplate.getHoloBlue());
dataSet.setLineWidth(1.5f);
dataSet.setDrawCircles(false);
dataSet.setDrawValues(false);
dataSet.setFillAlpha(65);
dataSet.setFillColor(ColorTemplate.getHoloBlue());
dataSet.setHighLightColor(Color.rgb(244, 117, 117));
dataSet.setDrawCircleHole(false);
}
示例15: formatLineDataSet
import com.github.mikephil.charting.data.LineDataSet; //導入方法依賴的package包/類
private void formatLineDataSet(LineDataSet set, int color, int width) {
set.setDrawValues(false);
set.setDrawHighlightIndicators(false);
set.setMode(LineDataSet.Mode.LINEAR);
set.setColor(color);
set.setLineWidth(width);
set.setCircleColor(color);
set.setCircleRadius(width + 2);
}