@Override protected void onResume() { super.onResume(); // setup realm // write some demo-data into the realm.io database writeToDB(40); // add data to the chart setData(); }
@SuppressWarnings("ButterKnifeInjectNotCalled") @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setup(mChart); mChart.getAxisLeft().setAxisMaximum(150f); mChart.getAxisLeft().setAxisMinimum(0f); mChart.getAxisLeft().setDrawGridLines(false); mChart.getXAxis().setDrawGridLines(false); }
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); // FLAG_FULLSCREEN // getWindow().setFlags(WindowManager.LayoutParams.FLAG_LAYOUT_IN_SCREEN, // WindowManager.LayoutParams.FLAG_LAYOUT_IN_SCREEN); setContentView(R.layout.activity_piechart_noseekbar); mChart = (PieChart) findViewById(R.id.chart1); setup(mChart); mChart.setCenterText(generateCenterSpannableText()); }
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); getWindow() .setFlags( WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN); setContentView(R.layout.activity_realm_wiki); lineChart = (LineChart) findViewById(R.id.lineChart); barChart = (BarChart) findViewById(R.id.barChart); setup(lineChart); setup(barChart); lineChart.getAxisLeft().setDrawGridLines(false); lineChart.getXAxis().setDrawGridLines(false); barChart.getAxisLeft().setDrawGridLines(false); barChart.getXAxis().setDrawGridLines(false); }
@Override protected void onResume() { super.onResume(); // setup realm mRealm.beginTransaction(); // write some demo-data into the realm.io database Score score1 = new Score(100f, 0, "Peter"); mRealm.copyToRealm(score1); Score score2 = new Score(110f, 1, "Lisa"); mRealm.copyToRealm(score2); Score score3 = new Score(130f, 2, "Dennis"); mRealm.copyToRealm(score3); Score score4 = new Score(70f, 3, "Luke"); mRealm.copyToRealm(score4); Score score5 = new Score(80f, 4, "Sarah"); mRealm.copyToRealm(score5); mRealm.commitTransaction(); // add data to the chart setData(); }