本文整理匯總了Java中com.github.mikephil.charting.data.LineDataSet.setCircleColorHole方法的典型用法代碼示例。如果您正苦於以下問題:Java LineDataSet.setCircleColorHole方法的具體用法?Java LineDataSet.setCircleColorHole怎麽用?Java LineDataSet.setCircleColorHole使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類com.github.mikephil.charting.data.LineDataSet
的用法示例。
在下文中一共展示了LineDataSet.setCircleColorHole方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: setUpChart
import com.github.mikephil.charting.data.LineDataSet; //導入方法依賴的package包/類
private boolean setUpChart(@NonNull Model model) {
final double[] accuracies = model.getAccuracies();
if (accuracies == null
|| accuracies.length == 0
|| model.getStepEpoch() < 1) {
return false;
}
mAccuracyData.clear();
for (int i = 0, len = model.getStepEpoch(); i < len; ++i) {
mAccuracyData.add(new Entry(i + 1, (float) accuracies[i]));
}
final LineDataSet set = new LineDataSet(mAccuracyData, getString(R.string.text_chart_left_axis));
set.setMode(LineDataSet.Mode.LINEAR);
set.setAxisDependency(YAxis.AxisDependency.LEFT);
set.setColor(ContextCompat.getColor(this, R.color.chart_left_axis));
set.setCircleColor(ContextCompat.getColor(this, R.color.chart_left_axis));
set.setHighLightColor(ContextCompat.getColor(this, R.color.chart_highlight));
set.setCircleColorHole(Color.WHITE);
set.setDrawCircleHole(true);
set.setHighlightEnabled(true);
set.setLineWidth(2F);
set.setCircleRadius(3F);
set.setDrawFilled(false);
final LineData group = new LineData(set);
group.setDrawValues(false);
setXAxis(model.getEpochs());
mChart.setData(group);
mChart.invalidate();
startChartAnimate();
return true;
}
示例2: drawBrightnessChart
import com.github.mikephil.charting.data.LineDataSet; //導入方法依賴的package包/類
private void drawBrightnessChart() {
final String brightnessCurveString = brightnessCurveData.toString();
List<Entry> entries = new ArrayList<>();
// "u" marks the start of the brightness curve data
int startIndex = brightnessCurveString.indexOf("u") + 1;
int endIndex = brightnessCurveString.indexOf("end");
if (endIndex == -1) endIndex = brightnessCurveString.length();
String[] brightnessStrings =
brightnessCurveString.substring(startIndex, endIndex).trim().split("\n");
for (String str : brightnessStrings) {
String[] arr = str.split(" ");
final float timestampMs = Integer.parseInt(arr[0]) / 1000f;
final float brightness = Integer.parseInt(arr[1]);
entries.add(new Entry(timestampMs, brightness));
}
LineDataSet dataSet = new LineDataSet(entries, "Brightness");
dataSet.setColor(Color.BLACK);
dataSet.setValueTextColor(Color.BLACK);
dataSet.setCircleColor(Color.BLACK);
dataSet.setCircleRadius(1.5f);
dataSet.setCircleColorHole(Color.DKGRAY);
LineData lineData = new LineData(dataSet);
brightnessChart.setData(lineData);
final Description desc = new Description();
desc.setText("Screen Brightness [digital level 0-1023] vs. Time [ms]");
desc.setTextSize(12f);
brightnessChart.setDescription(desc);
brightnessChart.getLegend().setEnabled(false);
brightnessChart.invalidate();
brightnessChartLayout.setVisibility(View.VISIBLE);
}
示例3: drawWaveformChart
import com.github.mikephil.charting.data.LineDataSet; //導入方法依賴的package包/類
private void drawWaveformChart() {
final short[] wave = AudioTest.getRecordedWave();
List<Entry> entries = new ArrayList<>();
int frameRate = audioTest.getOptimalFrameRate();
for (int i = 0; i < wave.length; i++) {
float timeStamp = (float) i / frameRate * 1000f;
entries.add(new Entry(timeStamp, (float) wave[i]));
}
LineDataSet dataSet = new LineDataSet(entries, "Waveform");
dataSet.setColor(Color.BLACK);
dataSet.setValueTextColor(Color.BLACK);
dataSet.setCircleColor(ContextCompat.getColor(getContext(), R.color.DarkGreen));
dataSet.setCircleRadius(1.5f);
dataSet.setCircleColorHole(Color.DKGRAY);
LineData lineData = new LineData(dataSet);
chart.setData(lineData);
LimitLine line = new LimitLine(audioTest.getThreshold(), "Threshold");
line.setLineColor(Color.RED);
line.setLabelPosition(LimitLine.LimitLabelPosition.LEFT_TOP);
line.setLineWidth(2f);
line.setTextColor(Color.DKGRAY);
line.setTextSize(10f);
chart.getAxisLeft().addLimitLine(line);
final Description desc = new Description();
desc.setText("Wave [digital level -32768 to +32767] vs. Time [ms]");
desc.setTextSize(12f);
chart.setDescription(desc);
chart.getLegend().setEnabled(false);
chart.invalidate();
chartLayout.setVisibility(View.VISIBLE);
}
示例4: dataSetConfig
import com.github.mikephil.charting.data.LineDataSet; //導入方法依賴的package包/類
@Override
void dataSetConfig(IDataSet<Entry> dataSet, ReadableMap config) {
LineDataSet lineDataSet = (LineDataSet) dataSet;
ChartDataSetConfigUtils.commonConfig(lineDataSet, config);
ChartDataSetConfigUtils.commonBarLineScatterCandleBubbleConfig(lineDataSet, config);
ChartDataSetConfigUtils.commonLineScatterCandleRadarConfig(lineDataSet, config);
ChartDataSetConfigUtils.commonLineRadarConfig(lineDataSet, config);
// LineDataSet only config
if (BridgeUtils.validate(config, ReadableType.Number, "circleRadius")) {
lineDataSet.setCircleRadius((float) config.getDouble("circleRadius"));
}
if (BridgeUtils.validate(config, ReadableType.Boolean, "drawCircles")) {
lineDataSet.setDrawCircles(config.getBoolean("drawCircles"));
}
if (BridgeUtils.validate(config, ReadableType.Boolean, "drawCubic")) {
lineDataSet.setDrawCubic(config.getBoolean("drawCubic"));
}
if (BridgeUtils.validate(config, ReadableType.Number, "drawCubicIntensity")) {
lineDataSet.setCubicIntensity((float) config.getDouble("drawCubicIntensity"));
}
if (BridgeUtils.validate(config, ReadableType.String, "circleColor")) {
lineDataSet.setCircleColor(Color.parseColor(config.getString("circleColor")));
}
if (BridgeUtils.validate(config, ReadableType.Array, "circleColors")) {
lineDataSet.setCircleColors(BridgeUtils.parseColors(config.getArray("circleColors")));
}
if (BridgeUtils.validate(config, ReadableType.String, "circleColorHole")) {
lineDataSet.setCircleColorHole(Color.parseColor(config.getString("circleColorHole")));
}
if (BridgeUtils.validate(config, ReadableType.Boolean, "drawCircleHole")) {
lineDataSet.setDrawCircleHole(config.getBoolean("drawCircleHole"));
}
if (BridgeUtils.validate(config, ReadableType.Map, "dashedLine")) {
ReadableMap dashedLine = config.getMap("dashedLine");
float lineLength = 0;
float spaceLength = 0;
float phase = 0;
if (BridgeUtils.validate(dashedLine, ReadableType.Number, "lineLength")) {
lineLength = (float) dashedLine.getDouble("lineLength");
}
if (BridgeUtils.validate(dashedLine, ReadableType.Number, "spaceLength")) {
spaceLength = (float) dashedLine.getDouble("spaceLength");
}
if (BridgeUtils.validate(dashedLine, ReadableType.Number, "phase")) {
phase = (float) dashedLine.getDouble("phase");
}
lineDataSet.enableDashedLine(lineLength, spaceLength, phase);
}
}