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; chart.animateX(2000);
chart.getDescription().setEnabled(false); chart.setOnChartValueSelectedListener(this); chart.setDrawGridBackground(false); chart.setTouchEnabled(true); chart.setDragEnabled(true); chart.setScaleEnabled(true); chart.setMaxVisibleValueCount(200); chart.setPinchZoom(true); Legend l = chart.getLegend(); l.setVerticalAlignment(Legend.LegendVerticalAlignment.TOP); l.setHorizontalAlignment(Legend.LegendHorizontalAlignment.RIGHT); YAxis yl = chart.getAxisLeft(); yl.setTypeface(tfLight); yl.setSpaceTop(30f); chart.getAxisRight().setEnabled(false); XAxis xl = chart.getXAxis(); xl.setPosition(XAxis.XAxisPosition.BOTTOM); xl.setTypeface(tfLight);
data.setHighlightCircleWidth(1.5f); chart.setData(data); chart.invalidate();
@SuppressWarnings("ButterKnifeInjectNotCalled") @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setup(mChart); mChart.getXAxis().setDrawGridLines(false); mChart.getAxisLeft().setDrawGridLines(false); mChart.setPinchZoom(true); }
private void setData() { RealmResults<RealmDemoData> result = mRealm.where(RealmDemoData.class).findAll(); RealmBubbleDataSet<RealmDemoData> set = new RealmBubbleDataSet<RealmDemoData>(result, "xValue", "yValue", "bubbleSize"); set.setLabel("Realm BubbleDataSet"); set.setColors(ColorTemplate.COLORFUL_COLORS, 110); ArrayList<IBubbleDataSet> dataSets = new ArrayList<IBubbleDataSet>(); dataSets.add(set); // add the dataset // create a data object with the dataset list BubbleData data = new BubbleData(dataSets); styleData(data); // set data mChart.setData(data); mChart.animateY(1400, Easing.EasingOption.EaseInOutQuart); }
data.setHighlightCircleWidth(1.5f); mChart.setData(data); mChart.invalidate();
mChart.getDescription().setEnabled(false); mChart.setOnChartValueSelectedListener(this); mChart.setDrawGridBackground(false); mChart.setTouchEnabled(true); mChart.setDragEnabled(true); mChart.setScaleEnabled(true); mChart.setMaxVisibleValueCount(200); mChart.setPinchZoom(true); Legend l = mChart.getLegend(); l.setVerticalAlignment(Legend.LegendVerticalAlignment.TOP); l.setHorizontalAlignment(Legend.LegendHorizontalAlignment.RIGHT); YAxis yl = mChart.getAxisLeft(); yl.setTypeface(mTfLight); yl.setSpaceTop(30f); mChart.getAxisRight().setEnabled(false); XAxis xl = mChart.getXAxis(); xl.setPosition(XAxis.XAxisPosition.BOTTOM); xl.setTypeface(mTfLight);
switch (item.getItemId()) { case R.id.actionToggleValues: { for (IDataSet set : mChart.getData().getDataSets()) set.setDrawValues(!set.isDrawValuesEnabled()); mChart.invalidate(); break; 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; mChart.saveToPath("title" + System.currentTimeMillis(), ""); break; mChart.animateX(3000); break;