private CandleData generateCandleData() { CandleData d = new CandleData(); ArrayList<CandleEntry> entries = new ArrayList<>(); for (int index = 0; index < count; index += 2) entries.add(new CandleEntry(index + 1f, 90, 70, 85, 75f)); CandleDataSet set = new CandleDataSet(entries, "Candle DataSet"); set.setDecreasingColor(Color.rgb(142, 150, 175)); set.setShadowColor(Color.DKGRAY); set.setBarSpace(0.3f); set.setValueTextSize(10f); set.setDrawValues(false); d.addDataSet(set); return d; }
protected CandleData generateCandleData() { CandleData d = new CandleData(); ArrayList<CandleEntry> entries = new ArrayList<>(); for (int index = 0; index < itemCount; index += 2) entries.add(new CandleEntry(index + 1f, 90, 70, 85, 75f)); CandleDataSet set = new CandleDataSet(entries, "Candle DataSet"); set.setDecreasingColor(Color.rgb(142, 150, 175)); set.setShadowColor(Color.DKGRAY); set.setBarSpace(0.3f); set.setValueTextSize(10f); set.setDrawValues(false); d.addDataSet(set); return d; }
private CandleDataSet setBOLLCandle(ArrayList<CandleEntry> candleEntries) { CandleDataSet candleDataSet = new CandleDataSet(candleEntries, "KLine"); candleDataSet.setDrawHorizontalHighlightIndicator(false); candleDataSet.setHighlightEnabled(landscape); candleDataSet.setHighLightColor(ContextCompat.getColor(mContext, R.color.highLight_Color)); candleDataSet.setAxisDependency(YAxis.AxisDependency.LEFT); candleDataSet.setDecreasingColor(ContextCompat.getColor(mContext, R.color.down_color)); candleDataSet.setDecreasingPaintStyle(Paint.Style.FILL); candleDataSet.setIncreasingColor(ContextCompat.getColor(mContext, R.color.up_color)); candleDataSet.setIncreasingPaintStyle(Paint.Style.FILL); candleDataSet.setNeutralColor(ContextCompat.getColor(mContext, R.color.equal_color)); candleDataSet.setDrawValues(false); candleDataSet.setShowCandleBar(false); return candleDataSet; }
private CandleDataSet setACandle(ArrayList<CandleEntry> candleEntries) { CandleDataSet candleDataSet = new CandleDataSet(candleEntries, "KLine"); candleDataSet.setDrawHorizontalHighlightIndicator(landscape); candleDataSet.setHighlightEnabled(landscape); candleDataSet.setHighLightColor(ContextCompat.getColor(mContext, R.color.highLight_Color)); candleDataSet.setAxisDependency(YAxis.AxisDependency.LEFT); candleDataSet.setDecreasingColor(ContextCompat.getColor(mContext, R.color.down_color)); candleDataSet.setDecreasingPaintStyle(Paint.Style.FILL); candleDataSet.setIncreasingColor(ContextCompat.getColor(mContext, R.color.up_color)); candleDataSet.setIncreasingPaintStyle(Paint.Style.FILL); candleDataSet.setNeutralColor(ContextCompat.getColor(mContext, R.color.equal_color)); candleDataSet.setShadowColorSameAsCandle(true); candleDataSet.setValueTextSize(10); candleDataSet.setDrawValues(true); return candleDataSet; }