本文整理匯總了Java中com.github.mikephil.charting.data.LineDataSet.setDrawCircles方法的典型用法代碼示例。如果您正苦於以下問題:Java LineDataSet.setDrawCircles方法的具體用法?Java LineDataSet.setDrawCircles怎麽用?Java LineDataSet.setDrawCircles使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類com.github.mikephil.charting.data.LineDataSet
的用法示例。
在下文中一共展示了LineDataSet.setDrawCircles方法的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: 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;
}
示例4: 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;
}
示例5: addMainDataSets
import com.github.mikephil.charting.data.LineDataSet; //導入方法依賴的package包/類
/**
* Adds the main data set for all times and the data set for the progression of record best
* times among all times. The progression of best times are marked in a different color to the
* main line of all time using circles lined with a dashed line. This will appear to connect
* the lowest troughs along the main line of all times.
*
* @param chartData The chart data to which to add the new data sets.
* @param allLabel The label of the all-times line.
* @param allColor The color of the all-times line.
* @param bestLabel The label of the best-times line.
* @param bestColor The color of the best-times line.
*/
private void addMainDataSets(LineData chartData, String allLabel, int allColor,
String bestLabel, int bestColor) {
// Main data set for all solve times.
chartData.addDataSet(createDataSet(allLabel, allColor));
// Data set to show the progression of best times along the main line of all times.
final LineDataSet bestDataSet = createDataSet(bestLabel, bestColor);
bestDataSet.enableDashedLine(3f, 6f, 0f);
bestDataSet.setDrawCircles(true);
bestDataSet.setCircleRadius(BEST_TIME_CIRCLE_RADIUS_DP);
bestDataSet.setCircleColor(bestColor);
bestDataSet.setDrawValues(false);
bestDataSet.setValueTextColor(bestColor);
bestDataSet.setValueTextSize(BEST_TIME_VALUES_TEXT_SIZE_DP);
bestDataSet.setValueFormatter(new TimeChartValueFormatter());
chartData.addDataSet(bestDataSet);
}
示例6: 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;
}
示例7: generateLineData
import com.github.mikephil.charting.data.LineDataSet; //導入方法依賴的package包/類
/**
* 曲線
*/
private LineData generateLineData() {
LineData lineData = new LineData();
ArrayList<Entry> entries = new ArrayList<>();
for (int index = 0; index < items.size(); index++) {
entries.add(new Entry(index + 1f, (float) items.get(index).sub_data.getData()));
}
LineDataSet lineDataSet = new LineDataSet(entries, "對比數據");
lineDataSet.setValues(entries);
lineDataSet.setDrawValues(false);//是否在線上顯示值
lineDataSet.setColor(ContextCompat.getColor(mContext, R.color.co3));
lineDataSet.setLineWidth(2.5f);
lineDataSet.setCircleColor(ContextCompat.getColor(mContext, R.color.co3));
lineDataSet.setCircleRadius(5f);
lineDataSet.setDrawCircles(false);
lineDataSet.setMode(LineDataSet.Mode.HORIZONTAL_BEZIER);//設置線條類型
//set.setDrawHorizontalHighlightIndicator(false);//隱藏選中線
//set.setDrawVerticalHighlightIndicator(false);//隱藏選中線條
lineDataSet.setAxisDependency(YAxis.AxisDependency.LEFT);
lineDataSet.setHighlightEnabled(false);
lineData.setHighlightEnabled(false);
lineData.addDataSet(lineDataSet);
return lineData;
}
示例8: generateLineData
import com.github.mikephil.charting.data.LineDataSet; //導入方法依賴的package包/類
/**
* Generate line data line data.
*
* @return the line data
*/
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;
}
示例9: createHeartrateSet
import com.github.mikephil.charting.data.LineDataSet; //導入方法依賴的package包/類
protected LineDataSet createHeartrateSet(List<Entry> values, String label) {
LineDataSet set1 = new LineDataSet(values, label);
set1.setLineWidth(0.8f);
set1.setColor(HEARTRATE_COLOR);
set1.setDrawCubic(true);
set1.setCubicIntensity(0.1f);
set1.setDrawCircles(false);
// set1.setCircleRadius(2f);
// set1.setDrawFilled(true);
// set1.setColor(getResources().getColor(android.R.color.background_light));
// set1.setCircleColor(HEARTRATE_COLOR);
// set1.setFillColor(ColorTemplate.getHoloBlue());
// set1.setHighLightColor(Color.rgb(128, 0, 255));
// set1.setColor(Color.rgb(89, 178, 44));
set1.setDrawValues(true);
set1.setValueTextColor(CHART_TEXT_COLOR);
set1.setAxisDependency(YAxis.AxisDependency.RIGHT);
return set1;
}
示例10: 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);
}
示例11: 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);
}
示例12: 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);
}
示例13: createSet
import com.github.mikephil.charting.data.LineDataSet; //導入方法依賴的package包/類
private LineDataSet createSet()
{
LineDataSet set=new LineDataSet(null, "Data");
set.setDrawCircles(true);
set.setAxisDependency(YAxis.AxisDependency.LEFT);
set.setColor(ColorTemplate.getHoloBlue());
set.setCircleColor(ColorTemplate.getHoloBlue());
set.setLineWidth(2f);
set.setCircleRadius(4f);
set.setFillAlpha(65);
set.setFillColor(ColorTemplate.getHoloBlue());
set.setHighLightColor(Color.rgb(244,117,177));
return set;
}
示例14: 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);
}
示例15: setupGraphic
import com.github.mikephil.charting.data.LineDataSet; //導入方法依賴的package包/類
private void setupGraphic(LineChart chart, List<Entry> entries, float axisMinimum, IAxisValueFormatter formatter) {
LineDataSet dataSet = new LineDataSet(entries, Constants.EMPTY_STRING);
dataSet.setDrawCircles(false);
dataSet.setDrawCircleHole(false);
dataSet.setLineWidth(ResourcesHelper.getDimensionPixelSize(this, R.dimen.half_dp));
dataSet.setFillColor(getResources().getColor(R.color.colorPrimary));
dataSet.setDrawFilled(true);
dataSet.setFillAlpha(Constants.Chart.ALPHA_FILL);
dataSet.setMode(LineDataSet.Mode.CUBIC_BEZIER);
dataSet.setColor(getResources().getColor(R.color.colorPrimary));
dataSet.setDrawValues(false);
LineData lineData = new LineData(dataSet);
chart.getDescription().setEnabled(false);
chart.setTouchEnabled(false);
chart.getLegend().setEnabled(false);
chart.getAxisRight().setEnabled(false);
chart.getXAxis().setDrawLabels(false);
chart.getXAxis().setDrawGridLines(false);
chart.getAxisLeft().removeAllLimitLines();
chart.getAxisLeft().setTextColor(getResources().getColor(R.color.gray));
chart.getAxisLeft().setAxisMinimum(axisMinimum);
chart.getAxisLeft().setTextSize(Constants.Chart.LABEL_SIZE);
chart.getAxisLeft().setValueFormatter(formatter);
chart.animateX(Constants.Chart.ANIMATION_DURATION, Easing.EasingOption.EaseInSine);
chart.setData(lineData);
chart.invalidate();
}