本文整理匯總了Java中com.github.mikephil.charting.data.LineDataSet.setLineWidth方法的典型用法代碼示例。如果您正苦於以下問題:Java LineDataSet.setLineWidth方法的具體用法?Java LineDataSet.setLineWidth怎麽用?Java LineDataSet.setLineWidth使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類com.github.mikephil.charting.data.LineDataSet
的用法示例。
在下文中一共展示了LineDataSet.setLineWidth方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: prepareInitData
import com.github.mikephil.charting.data.LineDataSet; //導入方法依賴的package包/類
private LineDataSet prepareInitData(@NonNull LineChart chart, @NonNull List<Entry> entries) {
final LineDataSet set = new LineDataSet(entries, "Accuracy");
set.setMode(LineDataSet.Mode.HORIZONTAL_BEZIER);
set.setAxisDependency(YAxis.AxisDependency.LEFT);
set.setLineWidth(2F);
set.setDrawCircleHole(false);
set.setDrawCircles(false);
set.setHighlightEnabled(false);
set.setDrawFilled(true);
final LineData group = new LineData(set);
group.setDrawValues(false);
chart.setData(group);
return set;
}
示例2: generateLineData
import com.github.mikephil.charting.data.LineDataSet; //導入方法依賴的package包/類
protected LineData generateLineData() {
ArrayList<ILineDataSet> sets = new ArrayList<ILineDataSet>();
LineDataSet ds1 = new LineDataSet(FileUtils.loadEntriesFromAssets(getActivity().getAssets(), "sine.txt"), "Sine function");
LineDataSet ds2 = new LineDataSet(FileUtils.loadEntriesFromAssets(getActivity().getAssets(), "cosine.txt"), "Cosine function");
ds1.setLineWidth(2f);
ds2.setLineWidth(2f);
ds1.setDrawCircles(false);
ds2.setDrawCircles(false);
ds1.setColor(ColorTemplate.VORDIPLOM_COLORS[0]);
ds2.setColor(ColorTemplate.VORDIPLOM_COLORS[1]);
// load DataSets from textfiles in assets folders
sets.add(ds1);
sets.add(ds2);
LineData d = new LineData(sets);
d.setValueTypeface(tf);
return d;
}
示例3: 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;
}
示例4: setData
import com.github.mikephil.charting.data.LineDataSet; //導入方法依賴的package包/類
private void setData(int count, float range) {
ArrayList<Entry> entries = new ArrayList<Entry>();
for (int i = 0; i < count; i++) {
float xVal = (float) (Math.random() * range);
float yVal = (float) (Math.random() * range);
entries.add(new Entry(xVal, yVal));
}
// sort by x-value
Collections.sort(entries, new EntryXComparator());
// create a dataset and give it a type
LineDataSet set1 = new LineDataSet(entries, "DataSet 1");
set1.setLineWidth(1.5f);
set1.setCircleRadius(4f);
// create a data object with the datasets
LineData data = new LineData(set1);
// set data
mChart.setData(data);
}
示例5: 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;
}
示例6: 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);
}
示例7: createDataSet
import com.github.mikephil.charting.data.LineDataSet; //導入方法依賴的package包/類
/**
* Creates a data set with the given label and color. Highlights and drawing of values and
* circles are disabled, as that is common for many cases.
*
* @param label The label to assign to the new data set.
* @param color The line color to set for the new data set.
*/
private LineDataSet createDataSet(String label, int color) {
// A legend is enabled on the chart view in the graph fragment. The legend is created
// automatically, but requires a unique labels and colors on each data set.
final LineDataSet dataSet = new LineDataSet(null, label);
// A dashed line can make peaks inaccurate. It also makes the graph look too "busy". It
// is OK for some uses, such as progressions of best times, but that is left to the caller
// to change once this new data set is returned.
//
// If graphing only times for a session, there will be fewer, and a thicker line will look
// well. However, if all times are graphed, a thinner line will probably look better, as
// the finer details will be more visible.
dataSet.setLineWidth(getLineWidth());
dataSet.setColor(color);
dataSet.setHighlightEnabled(false);
dataSet.setDrawCircles(false);
dataSet.setDrawValues(false);
return dataSet;
}
示例8: 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;
}
示例9: 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;
}
示例10: initWithDummyData
import com.github.mikephil.charting.data.LineDataSet; //導入方法依賴的package包/類
private void initWithDummyData() {
ArrayList<String> xVals = new ArrayList<String>();
for (int i = 0; i < 24; i++) {
xVals.add((i) + ":00");
}
ArrayList<Entry> yVals = new ArrayList<Entry>();
// create a dataset and give it a type (0)
LineDataSet set1 = new LineDataSet(yVals, "DataSet");
set1.setLineWidth(3f);
set1.setCircleRadius(5f);
ArrayList<ILineDataSet> dataSets = new ArrayList<ILineDataSet>();
dataSets.add(set1); // add the datasets
// create a data object with the datasets
LineData data = new LineData(xVals, dataSets);
mChart.setData(data);
}
示例11: 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;
}
示例12: initWithDummyData
import com.github.mikephil.charting.data.LineDataSet; //導入方法依賴的package包/類
private void initWithDummyData() {
ArrayList<Entry> yVals = new ArrayList<Entry>();
// create a dataset and give it a type (0)
LineDataSet set1 = new LineDataSet(yVals, "DataSet");
set1.setLineWidth(3f);
set1.setCircleRadius(5f);
// create a data object with the datasets
LineData data = new LineData(set1);
mChart.setData(data);
}
示例13: addDataSet
import com.github.mikephil.charting.data.LineDataSet; //導入方法依賴的package包/類
private void addDataSet() {
LineData data = mChart.getData();
if (data != null) {
int count = (data.getDataSetCount() + 1);
ArrayList<Entry> yVals = new ArrayList<Entry>();
for (int i = 0; i < data.getEntryCount(); i++) {
yVals.add(new Entry(i, (float) (Math.random() * 50f) + 50f * count));
}
LineDataSet set = new LineDataSet(yVals, "DataSet " + count);
set.setLineWidth(2.5f);
set.setCircleRadius(4.5f);
int color = mColors[count % mColors.length];
set.setColor(color);
set.setCircleColor(color);
set.setHighLightColor(color);
set.setValueTextSize(10f);
set.setValueTextColor(color);
data.addDataSet(set);
data.notifyDataChanged();
mChart.notifyDataSetChanged();
mChart.invalidate();
}
}
示例14: 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;
}
示例15: updateGraph
import com.github.mikephil.charting.data.LineDataSet; //導入方法依賴的package包/類
/**
*
*/
private void updateGraph(List<Entry> entries) {
LineDataSet dataSet = new LineDataSet(entries, "Label");
dataSet.setDrawValues(false);
dataSet.setLineWidth(2f);
dataSet.setDrawCircles(true);
dataSet.setDrawCircles(false);
LineData lineData = new LineData(dataSet);
_walletFragView.updateChartPriceData(lineData);
}