本文整理汇总了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);
}
}