CandleDataSet set1 = new CandleDataSet(values, "Data Set"); set1.setDrawIcons(false); set1.setAxisDependency(AxisDependency.LEFT); set1.setShadowColor(Color.DKGRAY); set1.setShadowWidth(0.7f); set1.setDecreasingColor(Color.RED); set1.setDecreasingPaintStyle(Paint.Style.FILL); set1.setIncreasingColor(Color.rgb(122, 242, 84)); set1.setIncreasingPaintStyle(Paint.Style.STROKE); set1.setNeutralColor(Color.BLUE);
@Override protected void calcMinMax(CandleEntry e) { if (e.getLow() < mYMin) mYMin = e.getLow(); if (e.getHigh() > mYMax) mYMax = e.getHigh(); calcMinMaxX(e); }
@Override public DataSet<CandleEntry> copy() { List<CandleEntry> entries = new ArrayList<CandleEntry>(); for (int i = 0; i < mValues.size(); i++) { entries.add(mValues.get(i).copy()); } CandleDataSet copied = new CandleDataSet(entries, getLabel()); copy(copied); return copied; }
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; }
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; }
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; }
@Override public DataSet<CandleEntry> copy() { List<CandleEntry> yVals = new ArrayList<CandleEntry>(); yVals.clear(); for (int i = 0; i < mValues.size(); i++) { yVals.add(mValues.get(i).copy()); } CandleDataSet copied = new CandleDataSet(yVals, getLabel()); copied.mColors = mColors; copied.mShadowWidth = mShadowWidth; copied.mShowCandleBar = mShowCandleBar; copied.mBarSpace = mBarSpace; copied.mHighLightColor = mHighLightColor; copied.mIncreasingPaintStyle = mIncreasingPaintStyle; copied.mDecreasingPaintStyle = mDecreasingPaintStyle; copied.mShadowColor = mShadowColor; return copied; }
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; }
@Override public DataSet<CandleEntry> copy() { List<CandleEntry> yVals = new ArrayList<CandleEntry>(); yVals.clear(); for (int i = 0; i < mValues.size(); i++) { yVals.add(mValues.get(i).copy()); } CandleDataSet copied = new CandleDataSet(yVals, getLabel()); copied.mColors = mColors; copied.mShadowWidth = mShadowWidth; copied.mShowCandleBar = mShowCandleBar; copied.mBarSpace = mBarSpace; copied.mHighLightColor = mHighLightColor; copied.mIncreasingPaintStyle = mIncreasingPaintStyle; copied.mDecreasingPaintStyle = mDecreasingPaintStyle; copied.mShadowColor = mShadowColor; return copied; }
CandleDataSet set1 = new CandleDataSet(yVals1, "Data Set"); set1.setAxisDependency(AxisDependency.LEFT); set1.setShadowColor(Color.DKGRAY); set1.setShadowWidth(0.7f); set1.setDecreasingColor(Color.RED); set1.setDecreasingPaintStyle(Paint.Style.FILL); set1.setIncreasingColor(Color.rgb(122, 242, 84)); set1.setIncreasingPaintStyle(Paint.Style.STROKE); set1.setNeutralColor(Color.BLUE);
@Override public DataSet<CandleEntry> copy() { List<CandleEntry> yVals = new ArrayList<CandleEntry>(); yVals.clear(); for (int i = 0; i < mValues.size(); i++) { yVals.add(mValues.get(i).copy()); } CandleDataSet copied = new CandleDataSet(yVals, getLabel()); copied.mColors = mColors; copied.mShadowWidth = mShadowWidth; copied.mShowCandleBar = mShowCandleBar; copied.mBarSpace = mBarSpace; copied.mHighLightColor = mHighLightColor; copied.mIncreasingPaintStyle = mIncreasingPaintStyle; copied.mDecreasingPaintStyle = mDecreasingPaintStyle; copied.mShadowColor = mShadowColor; return copied; }
@Override public DataSet<CandleEntry> copy() { List<CandleEntry> entries = new ArrayList<CandleEntry>(); for (int i = 0; i < mValues.size(); i++) { entries.add(mValues.get(i).copy()); } CandleDataSet copied = new CandleDataSet(entries, getLabel()); copy(copied); return copied; }
@Override protected void calcMinMax(CandleEntry e) { if (e.getLow() < mYMin) mYMin = e.getLow(); if (e.getHigh() > mYMax) mYMax = e.getHigh(); calcMinMaxX(e); }
@Override protected void calcMinMax(CandleEntry e) { if (e.getLow() < mYMin) mYMin = e.getLow(); if (e.getHigh() > mYMax) mYMax = e.getHigh(); calcMinMaxX(e); }
@Override protected void calcMinMax(CandleEntry e) { if (e.getLow() < mYMin) mYMin = e.getLow(); if (e.getHigh() > mYMax) mYMax = e.getHigh(); calcMinMaxX(e); }
@Override protected void calcMinMax(CandleEntry e) { if (e.getLow() < mYMin) mYMin = e.getLow(); if (e.getHigh() > mYMax) mYMax = e.getHigh(); calcMinMaxX(e); }