From 73a7dc9295cabf7951f47198c2a00efe830f803d Mon Sep 17 00:00:00 2001 From: septiawanajipradana Date: Fri, 15 Sep 2023 23:11:23 +0700 Subject: [PATCH] feat: add more example of chart usage --- .../androidchartjsapp/MainActivity.kt | 19 ++- app/src/main/res/layout/activity_main.xml | 122 ++++++++++++------ 2 files changed, 102 insertions(+), 39 deletions(-) diff --git a/app/src/main/java/com/dewakoding/androidchartjsapp/MainActivity.kt b/app/src/main/java/com/dewakoding/androidchartjsapp/MainActivity.kt index 831e570..ea3819f 100644 --- a/app/src/main/java/com/dewakoding/androidchartjsapp/MainActivity.kt +++ b/app/src/main/java/com/dewakoding/androidchartjsapp/MainActivity.kt @@ -13,12 +13,27 @@ class MainActivity : AppCompatActivity() { setContentView(binding.root) binding.androidChart1.setChart( - ChartType.RADAR, + ChartType.BAR, arrayOf("Sunday", "Monday", "Tuesday", "Wednesday", "Thursday"), arrayOf(10, 3, 5, 8, 9), "of quantity") binding.androidChart2.setChart( - ChartType.BAR, + ChartType.LINE, + arrayOf("Sunday", "Monday", "Tuesday", "Wednesday", "Thursday"), + arrayOf(10, 3, 5, 8, 9), + "of quantity") + binding.androidChart3.setChart( + ChartType.PIE, + arrayOf("Sunday", "Monday", "Tuesday", "Wednesday", "Thursday"), + arrayOf(10, 3, 5, 8, 9), + "of quantity") + binding.androidChart4.setChart( + ChartType.DOUGHNUT, + arrayOf("Sunday", "Monday", "Tuesday", "Wednesday", "Thursday"), + arrayOf(10, 3, 5, 8, 9), + "of quantity") + binding.androidChart5.setChart( + ChartType.POLAR_AREA, arrayOf("Sunday", "Monday", "Tuesday", "Wednesday", "Thursday"), arrayOf(10, 3, 5, 8, 9), "of quantity") diff --git a/app/src/main/res/layout/activity_main.xml b/app/src/main/res/layout/activity_main.xml index 3ab4520..64b020c 100644 --- a/app/src/main/res/layout/activity_main.xml +++ b/app/src/main/res/layout/activity_main.xml @@ -1,46 +1,94 @@ - - - - - - + android:layout_height="match_parent" + android:orientation="vertical"> + + + + + + + + + + + + + + - \ No newline at end of file + \ No newline at end of file