chart.setBackgroundColor(Color.WHITE); chart.getDescription().setEnabled(false); chart.setMaxVisibleValueCount(60); chart.setPinchZoom(false); chart.setDrawGridBackground(false); XAxis xAxis = chart.getXAxis(); xAxis.setPosition(XAxisPosition.BOTTOM); xAxis.setDrawGridLines(false); YAxis leftAxis = chart.getAxisLeft(); leftAxis.setDrawAxisLine(false); YAxis rightAxis = chart.getAxisRight(); rightAxis.setEnabled(false); seekBarY.setProgress(100); chart.getLegend().setEnabled(false);
for (IDataSet set : chart.getData().getDataSets()) set.setDrawValues(!set.isDrawValuesEnabled()); chart.invalidate(); break; for (IDataSet set : chart.getData().getDataSets()) set.setDrawIcons(!set.isDrawIconsEnabled()); chart.invalidate(); break; if(chart.getData() != null) { chart.getData().setHighlightEnabled(!chart.getData().isHighlightEnabled()); chart.invalidate(); if (chart.isPinchZoomEnabled()) chart.setPinchZoom(false); else chart.setPinchZoom(true); chart.invalidate(); break; chart.setAutoScaleMinMaxEnabled(!chart.isAutoScaleMinMaxEnabled()); chart.notifyDataSetChanged(); break; for (ICandleDataSet set : chart.getData().getDataSets()) {
@SuppressWarnings("ButterKnifeInjectNotCalled") @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setup(mChart); mChart.getAxisLeft().setDrawGridLines(false); mChart.getXAxis().setDrawGridLines(false); }
private void setData() { RealmResults<RealmDemoData> result = mRealm.where(RealmDemoData.class).findAll(); RealmCandleDataSet<RealmDemoData> set = new RealmCandleDataSet<RealmDemoData>(result, "xValue", "high", "low", "open", "close"); set.setLabel("Realm CandleDataSet"); set.setShadowColor(Color.DKGRAY); set.setShadowWidth(0.7f); set.setDecreasingColor(Color.RED); set.setDecreasingPaintStyle(Paint.Style.FILL); set.setIncreasingColor(Color.rgb(122, 242, 84)); set.setIncreasingPaintStyle(Paint.Style.STROKE); set.setNeutralColor(Color.BLUE); ArrayList<ICandleDataSet> dataSets = new ArrayList<ICandleDataSet>(); dataSets.add(set); // add the dataset // create a data object with the dataset list CandleData data = new CandleData(dataSets); styleData(data); // set data mChart.setData(data); mChart.animateY(1400, Easing.EasingOption.EaseInOutQuart); }
super.onCreate(savedInstanceState); mChart.setBackgroundColor(Color.WHITE); mChart.getDescription().setEnabled(false); mChart.setMaxVisibleValueCount(60); mChart.setPinchZoom(false); mChart.setDrawGridBackground(false); XAxis xAxis = mChart.getXAxis(); xAxis.setPosition(XAxisPosition.BOTTOM); xAxis.setDrawGridLines(false); YAxis leftAxis = mChart.getAxisLeft(); leftAxis.setDrawAxisLine(false); YAxis rightAxis = mChart.getAxisRight(); rightAxis.setEnabled(false); mSeekBarY.setProgress(100); mChart.getLegend().setEnabled(false);
switch (item.getItemId()) { case R.id.actionToggleHighlight: { if(mChart.getData() != null) { mChart.getData().setHighlightEnabled(!mChart.getData().isHighlightEnabled()); mChart.invalidate(); if (mChart.isPinchZoomEnabled()) mChart.setPinchZoom(false); else mChart.setPinchZoom(true); mChart.invalidate(); break; mChart.setAutoScaleMinMaxEnabled(!mChart.isAutoScaleMinMaxEnabled()); mChart.notifyDataSetChanged(); break; for (ICandleDataSet set : mChart.getData().getDataSets()) { mChart.invalidate(); break; mChart.animateX(3000); break; mChart.animateY(3000); break;