├── .github ├── PULL_REQUEST_TEMPLATE │ └── pull_request_template.md └── workflows │ ├── android.yml │ └── publish.yml ├── .gitignore ├── CODEOWNERS ├── LICENSE ├── README.md ├── YChartsLib ├── build.gradle.kts ├── proguard-rules.pro └── src │ ├── androidTest │ └── java │ │ └── co │ │ └── yml │ │ └── charts │ │ ├── YChartsTest.kt │ │ ├── barchart │ │ └── StackedBarChartTest.kt │ │ ├── piechart │ │ ├── DonutPieChartTest.kt │ │ └── PieChartTest.kt │ │ └── wavechart │ │ └── WaveChartTest.kt │ ├── main │ ├── AndroidManifest.xml │ └── java │ │ └── co │ │ └── yml │ │ └── charts │ │ ├── axis │ │ ├── AxisData.kt │ │ ├── Gravity.kt │ │ ├── XAxis.kt │ │ └── YAxis.kt │ │ ├── chartcontainer │ │ ├── container │ │ │ └── ScrollableCanvasContainer.kt │ │ └── gestures │ │ │ └── GestureExtensions.kt │ │ ├── common │ │ ├── components │ │ │ ├── ItemDivider.kt │ │ │ ├── Legends.kt │ │ │ └── accessibility │ │ │ │ ├── AccessibilityBottomSheetDailog.kt │ │ │ │ ├── BarInfo.kt │ │ │ │ ├── BubblePointInfo.kt │ │ │ │ ├── CombinedChartInfo.kt │ │ │ │ ├── GroupBarInfo.kt │ │ │ │ ├── LinePointInfo.kt │ │ │ │ └── SliceInfo.kt │ │ ├── extensions │ │ │ └── Extensions.kt │ │ ├── model │ │ │ ├── AccessibilityConfig.kt │ │ │ ├── LegendsConfig.kt │ │ │ ├── PlotData.kt │ │ │ └── Point.kt │ │ └── utils │ │ │ ├── ChartConstants.kt │ │ │ └── DataUtils.kt │ │ └── ui │ │ ├── barchart │ │ ├── BarChart.kt │ │ ├── GroupBarChart.kt │ │ ├── HorizontalBarChart.kt │ │ ├── StackedBarChart.kt │ │ ├── VerticalBarChart.kt │ │ ├── models │ │ │ ├── BarChartData.kt │ │ │ ├── BarChartType.kt │ │ │ ├── BarData.kt │ │ │ ├── BarPlotData.kt │ │ │ ├── GroupBar.kt │ │ │ ├── GroupBarChartData.kt │ │ │ ├── GroupSeparatorConfig.kt │ │ │ └── SelectionHighlightData.kt │ │ └── utils.kt │ │ ├── bubblechart │ │ ├── BubbleChart.kt │ │ └── model │ │ │ ├── BubbleChartData.kt │ │ │ └── BubbleStyle.kt │ │ ├── combinedchart │ │ ├── CombinedChart.kt │ │ └── model │ │ │ └── CombinedChartData.kt │ │ ├── linechart │ │ ├── LineChart.kt │ │ ├── LineChartExtensions.kt │ │ └── model │ │ │ ├── GridLines.kt │ │ │ ├── IntersectionPoint.kt │ │ │ ├── LineChartData.kt │ │ │ ├── LinePlotData.kt │ │ │ ├── LineStyle.kt │ │ │ ├── SelectionHighlightPoint.kt │ │ │ ├── SelectionHighlightPopUp.kt │ │ │ └── ShadowUnderLine.kt │ │ ├── piechart │ │ ├── ChartWrapper.kt │ │ ├── PieChartConstants.kt │ │ ├── charts │ │ │ ├── DonutPieChart.kt │ │ │ ├── DrawPie.kt │ │ │ └── PieChart.kt │ │ ├── models │ │ │ ├── PieChartConfig.kt │ │ │ └── PieChartData.kt │ │ └── utils │ │ │ └── PieChartUtils.kt │ │ └── wavechart │ │ ├── WaveChart.kt │ │ └── model │ │ ├── WaveChartData.kt │ │ └── WavePlotData.kt │ └── test │ └── java │ └── co │ └── yml │ └── charts │ ├── axis │ ├── XGraphExtensionsTest.kt │ └── YChartsExtensionsTest.kt │ ├── chartcontainer │ └── ScrollableCanvasContainerTest.kt │ ├── extensions │ └── ExtensionsTest.kt │ ├── ui │ ├── bargraph │ │ └── BarChartTest.kt │ ├── bubblechart │ │ └── BubbleChartTest.kt │ ├── linegraph │ │ ├── LineChartExtensionsTest.kt │ │ └── LineChartTest.kt │ └── wavechart │ │ └── WaveChartTest.kt │ └── utils │ └── PieChartUtilsTest.kt ├── app ├── .gitignore ├── build.gradle.kts ├── proguard-rules.pro └── src │ ├── androidTest │ └── java │ │ └── co │ │ └── yml │ │ └── ycharts │ │ └── app │ │ └── ExampleInstrumentedTest.kt │ ├── main │ ├── AndroidManifest.xml │ ├── java │ │ └── co │ │ │ └── yml │ │ │ └── ycharts │ │ │ └── app │ │ │ ├── MainActivity.kt │ │ │ ├── presentation │ │ │ ├── BarChartActivity.kt │ │ │ ├── BubbleChartActivity.kt │ │ │ ├── CombinedLineAndBarChartActivity.kt │ │ │ ├── DonutChartActivity.kt │ │ │ ├── LineChartActivity.kt │ │ │ ├── PieChartActivity.kt │ │ │ └── WaveChartActivity.kt │ │ │ └── ui │ │ │ ├── compositions │ │ │ └── AppBarWithBackButton.kt │ │ │ └── theme │ │ │ ├── Color.kt │ │ │ ├── Shape.kt │ │ │ ├── Theme.kt │ │ │ └── Type.kt │ └── res │ │ ├── anim │ │ ├── move_left_out_activity.xml │ │ └── move_right_in_activity.xml │ │ ├── drawable-v24 │ │ └── ic_launcher_foreground.xml │ │ ├── drawable │ │ ├── ic_back_arrow.xml │ │ └── ic_launcher_background.xml │ │ ├── mipmap-anydpi-v26 │ │ ├── ic_launcher.xml │ │ └── ic_launcher_round.xml │ │ ├── mipmap-hdpi │ │ ├── ic_launcher.webp │ │ └── ic_launcher_round.webp │ │ ├── mipmap-mdpi │ │ ├── ic_launcher.webp │ │ └── ic_launcher_round.webp │ │ ├── mipmap-xhdpi │ │ ├── ic_launcher.webp │ │ └── ic_launcher_round.webp │ │ ├── mipmap-xxhdpi │ │ ├── ic_launcher.webp │ │ └── ic_launcher_round.webp │ │ ├── mipmap-xxxhdpi │ │ ├── ic_launcher.webp │ │ └── ic_launcher_round.webp │ │ ├── values │ │ ├── colors.xml │ │ ├── strings.xml │ │ └── themes.xml │ │ └── xml │ │ ├── backup_rules.xml │ │ └── data_extraction_rules.xml │ └── test │ └── java │ └── co │ └── yml │ └── ycharts │ └── app │ └── ExampleUnitTest.kt ├── build-logic ├── .gitignore ├── build.gradle.kts ├── settings.gradle.kts └── src │ └── main │ └── java │ ├── conventions │ ├── AndroidTestConventionPlugin.kt │ ├── ApplicationConventionPlugin.kt │ ├── ComposeApplicationConventionPlugin.kt │ ├── LibraryComposeConventionPlugin.kt │ └── LibraryConventionPlugin.kt │ └── ycharts │ └── android │ ├── AppBuildType.kt │ ├── ComposeApplication.kt │ └── KotlinAndroid.kt ├── build.gradle.kts ├── experiments ├── chartcontainer │ ├── .gitignore │ ├── build.gradle.kts │ ├── proguard-rules.pro │ └── src │ │ ├── androidTest │ │ └── java │ │ │ └── com │ │ │ └── app │ │ │ └── chartcontainer │ │ │ └── ExampleInstrumentedTest.kt │ │ ├── main │ │ ├── AndroidManifest.xml │ │ ├── java │ │ │ └── com │ │ │ │ └── app │ │ │ │ └── chartcontainer │ │ │ │ ├── LineChartActivity.kt │ │ │ │ ├── MainActivity.kt │ │ │ │ └── ui │ │ │ │ └── theme │ │ │ │ ├── Color.kt │ │ │ │ ├── Shape.kt │ │ │ │ ├── Theme.kt │ │ │ │ └── Type.kt │ │ └── res │ │ │ ├── drawable-v24 │ │ │ └── ic_launcher_foreground.xml │ │ │ ├── drawable │ │ │ └── ic_launcher_background.xml │ │ │ ├── mipmap-anydpi-v26 │ │ │ ├── ic_launcher.xml │ │ │ └── ic_launcher_round.xml │ │ │ ├── mipmap-hdpi │ │ │ ├── ic_launcher.webp │ │ │ └── ic_launcher_round.webp │ │ │ ├── mipmap-mdpi │ │ │ ├── ic_launcher.webp │ │ │ └── ic_launcher_round.webp │ │ │ ├── mipmap-xhdpi │ │ │ ├── ic_launcher.webp │ │ │ └── ic_launcher_round.webp │ │ │ ├── mipmap-xxhdpi │ │ │ ├── ic_launcher.webp │ │ │ └── ic_launcher_round.webp │ │ │ ├── mipmap-xxxhdpi │ │ │ ├── ic_launcher.webp │ │ │ └── ic_launcher_round.webp │ │ │ └── values │ │ │ ├── colors.xml │ │ │ ├── strings.xml │ │ │ └── themes.xml │ │ └── test │ │ └── java │ │ └── com │ │ └── app │ │ └── chartcontainer │ │ └── ExampleUnitTest.kt └── piechartcontainer │ ├── .gitignore │ ├── build.gradle.kts │ ├── proguard-rules.pro │ └── src │ ├── androidTest │ └── java │ │ └── com │ │ └── example │ │ └── piechartcontainer │ │ └── ExampleInstrumentedTest.kt │ ├── main │ ├── AndroidManifest.xml │ ├── java │ │ └── com │ │ │ └── example │ │ │ └── piechartcontainer │ │ │ ├── BarChartActivity.kt │ │ │ ├── ChartContainer.kt │ │ │ ├── MainActivity.kt │ │ │ ├── PieChartActivity.kt │ │ │ └── ui │ │ │ └── theme │ │ │ ├── Color.kt │ │ │ ├── Shape.kt │ │ │ ├── Theme.kt │ │ │ └── Type.kt │ └── res │ │ ├── drawable-v24 │ │ └── ic_launcher_foreground.xml │ │ ├── drawable │ │ └── ic_launcher_background.xml │ │ ├── mipmap-anydpi-v26 │ │ ├── ic_launcher.xml │ │ └── ic_launcher_round.xml │ │ ├── mipmap-hdpi │ │ ├── ic_launcher.webp │ │ └── ic_launcher_round.webp │ │ ├── mipmap-mdpi │ │ ├── ic_launcher.webp │ │ └── ic_launcher_round.webp │ │ ├── mipmap-xhdpi │ │ ├── ic_launcher.webp │ │ └── ic_launcher_round.webp │ │ ├── mipmap-xxhdpi │ │ ├── ic_launcher.webp │ │ └── ic_launcher_round.webp │ │ ├── mipmap-xxxhdpi │ │ ├── ic_launcher.webp │ │ └── ic_launcher_round.webp │ │ └── values │ │ ├── colors.xml │ │ ├── strings.xml │ │ └── themes.xml │ └── test │ └── java │ └── com │ └── example │ └── piechartcontainer │ └── ExampleUnitTest.kt ├── gradle.properties ├── gradle ├── libs.versions.toml └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat ├── renovate.json └── settings.gradle.kts /.github/PULL_REQUEST_TEMPLATE/pull_request_template.md: -------------------------------------------------------------------------------- 1 | ## :loudspeaker: Type of change 2 | 3 | 4 | - [ ] Bugfix 5 | - [ ] New feature 6 | - [ ] Enhancement 7 | - [ ] Refactoring 8 | 9 | ## :scroll: Description 10 | 11 | 12 | ## :bulb: Motivation and Context 13 | 14 | 15 | 16 | ## :green_heart: How did you test it? 17 | 18 | 19 | ## :pencil: Checklist 20 | 21 | 22 | - [ ] I reviewed submitted code 23 | - [ ] I added tests to verify changes 24 | - [ ] All tests passing 25 | - [ ] All linters passing 26 | - [ ] There are no code climate issues 27 | 28 | ## :crystal_ball: Next steps 29 | 30 | 31 | 32 | ## :camera_flash: Screenshots / GIFs 33 | 34 | 35 | 8 | 9 | 13 | -------------------------------------------------------------------------------- /app/src/main/res/xml/data_extraction_rules.xml: -------------------------------------------------------------------------------- 1 | 6 | 7 | 8 | 12 | 13 | 19 | -------------------------------------------------------------------------------- /app/src/test/java/co/yml/ycharts/app/ExampleUnitTest.kt: -------------------------------------------------------------------------------- 1 | package co.yml.ycharts.app 2 | 3 | import org.junit.Test 4 | 5 | import org.junit.Assert.* 6 | 7 | /** 8 | * Example local unit test, which will execute on the development machine (host). 9 | * 10 | * See [testing documentation](http://d.android.com/tools/testing). 11 | */ 12 | class ExampleUnitTest { 13 | @Test 14 | fun addition_isCorrect() { 15 | assertEquals(4, 2 + 2) 16 | } 17 | } -------------------------------------------------------------------------------- /build-logic/.gitignore: -------------------------------------------------------------------------------- 1 | /build -------------------------------------------------------------------------------- /build-logic/build.gradle.kts: -------------------------------------------------------------------------------- 1 | plugins { 2 | `kotlin-dsl` 3 | } 4 | 5 | group = "ycharts.android.buildlogic" 6 | 7 | repositories { 8 | mavenCentral() 9 | google() 10 | } 11 | 12 | java { 13 | sourceCompatibility = JavaVersion.VERSION_11 14 | targetCompatibility = JavaVersion.VERSION_11 15 | } 16 | 17 | dependencies { 18 | compileOnly(versionCatalogLibs.android.gradle.plugin) 19 | compileOnly(versionCatalogLibs.kotlin.gradle.plugin) 20 | } 21 | 22 | tasks.withType().configureEach { 23 | kotlinOptions { 24 | jvmTarget = JavaVersion.VERSION_11.toString() 25 | } 26 | } 27 | gradlePlugin { 28 | plugins { 29 | register("androidApplication") { 30 | id = "ycharts.android.application" 31 | implementationClass = "conventions.ApplicationConventionPlugin" 32 | } 33 | 34 | register("androidApplicationCompose") { 35 | id = "ycharts.android.application.compose" 36 | implementationClass = "conventions.ComposeApplicationConventionPlugin" 37 | } 38 | 39 | register("androidLibraryCompose") { 40 | id = "ycharts.android.library.compose" 41 | implementationClass = "conventions.LibraryComposeConventionPlugin" 42 | } 43 | 44 | register("androidLibrary") { 45 | id = "ycharts.android.library" 46 | implementationClass = "conventions.LibraryConventionPlugin" 47 | } 48 | 49 | register("androidTest") { 50 | id = "ycharts.android.test" 51 | implementationClass = "conventions.AndroidTestConventionPlugin" 52 | } 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /build-logic/settings.gradle.kts: -------------------------------------------------------------------------------- 1 | dependencyResolutionManagement { 2 | repositories { 3 | google() 4 | mavenCentral() 5 | } 6 | versionCatalogs { 7 | create("versionCatalogLibs") { 8 | from(files("../gradle/libs.versions.toml")) 9 | } 10 | } 11 | } 12 | rootProject.name = "build-logic" -------------------------------------------------------------------------------- /build-logic/src/main/java/conventions/AndroidTestConventionPlugin.kt: -------------------------------------------------------------------------------- 1 | package conventions 2 | 3 | import org.gradle.api.Plugin 4 | import org.gradle.api.Project 5 | import org.gradle.api.artifacts.VersionCatalogsExtension 6 | import org.gradle.kotlin.dsl.dependencies 7 | import org.gradle.kotlin.dsl.getByType 8 | import org.gradle.kotlin.dsl.kotlin 9 | 10 | /** 11 | * Android test convention plugin 12 | * 13 | * @constructor Create empty Android test convention plugin 14 | */ 15 | class AndroidTestConventionPlugin : Plugin { 16 | override fun apply(target: Project) { 17 | with(target) { 18 | val libs = extensions.getByType().named("versionCatalogLibs") 19 | dependencies { 20 | add("testImplementation", libs.findBundle("test").get()) 21 | add("testImplementation", libs.findBundle("mock").get()) 22 | add("testImplementation", libs.findBundle("coroutine.test").get()) 23 | add("testImplementation", libs.findLibrary("androidx.junit").get()) 24 | add("androidTestImplementation", kotlin("test")) 25 | add("testImplementation", kotlin("test")) 26 | } 27 | 28 | } 29 | } 30 | 31 | } 32 | -------------------------------------------------------------------------------- /build-logic/src/main/java/conventions/ApplicationConventionPlugin.kt: -------------------------------------------------------------------------------- 1 | package conventions 2 | 3 | import com.android.build.api.dsl.ApplicationExtension 4 | import com.android.build.api.dsl.Packaging 5 | import org.gradle.api.Plugin 6 | import org.gradle.api.Project 7 | import org.gradle.api.artifacts.VersionCatalogsExtension 8 | import org.gradle.kotlin.dsl.configure 9 | import org.gradle.kotlin.dsl.getByType 10 | import ycharts.android.configureKotlinAndroid 11 | 12 | /** 13 | * Application convention plugin 14 | * 15 | * @constructor Create empty Application convention plugin 16 | */ 17 | class ApplicationConventionPlugin : Plugin { 18 | override fun apply(target: Project) { 19 | with(target) { 20 | val libs = extensions.getByType().named("versionCatalogLibs") 21 | with(pluginManager) { 22 | apply(libs.findPlugin("android.application").get().get().pluginId) 23 | apply(libs.findPlugin("kotlin.android").get().get().pluginId) 24 | } 25 | extensions.configure { 26 | configureKotlinAndroid(this) 27 | fun Packaging.() { 28 | resources { 29 | excludes += "/META-INF/{AL2.0,LGPL2.1}" 30 | excludes += "META-INF/DEPENDENCIES" 31 | excludes += "META-INF/gradle/*" 32 | } 33 | } 34 | defaultConfig.targetSdk = 33 35 | } 36 | } 37 | } 38 | 39 | } 40 | -------------------------------------------------------------------------------- /build-logic/src/main/java/conventions/ComposeApplicationConventionPlugin.kt: -------------------------------------------------------------------------------- 1 | package conventions 2 | 3 | import com.android.build.api.dsl.ApplicationExtension 4 | import org.gradle.api.Plugin 5 | import org.gradle.api.Project 6 | import org.gradle.api.artifacts.VersionCatalogsExtension 7 | import org.gradle.kotlin.dsl.getByType 8 | import ycharts.android.configureComposeApplication 9 | 10 | 11 | /** 12 | * Compose application convention plugin 13 | * 14 | * @constructor Create empty Compose application convention plugin 15 | */ 16 | class ComposeApplicationConventionPlugin : Plugin { 17 | override fun apply(target: Project) { 18 | with(target) { 19 | val libs = extensions.getByType().named("versionCatalogLibs") 20 | pluginManager.apply(libs.findPlugin("android.application").get().get().pluginId) 21 | val extension = extensions.getByType() 22 | configureComposeApplication(extension) 23 | } 24 | } 25 | 26 | } 27 | -------------------------------------------------------------------------------- /build-logic/src/main/java/conventions/LibraryComposeConventionPlugin.kt: -------------------------------------------------------------------------------- 1 | package conventions 2 | 3 | import com.android.build.gradle.LibraryExtension 4 | import org.gradle.api.Plugin 5 | import org.gradle.api.Project 6 | import org.gradle.api.artifacts.VersionCatalogsExtension 7 | import org.gradle.kotlin.dsl.getByType 8 | import ycharts.android.configureComposeApplication 9 | 10 | /** 11 | * Library compose convention plugin 12 | * 13 | * @constructor Create empty Library compose convention plugin 14 | */ 15 | class LibraryComposeConventionPlugin : Plugin { 16 | override fun apply(target: Project) { 17 | with(target) { 18 | val libs = extensions.getByType().named("versionCatalogLibs") 19 | pluginManager.apply(libs.findPlugin("android.library").get().get().pluginId) 20 | val extension = extensions.getByType() 21 | configureComposeApplication(extension) 22 | } 23 | } 24 | 25 | } 26 | -------------------------------------------------------------------------------- /build-logic/src/main/java/conventions/LibraryConventionPlugin.kt: -------------------------------------------------------------------------------- 1 | package conventions 2 | 3 | import com.android.build.gradle.LibraryExtension 4 | import org.gradle.api.Plugin 5 | import org.gradle.api.Project 6 | import org.gradle.api.artifacts.VersionCatalogsExtension 7 | import org.gradle.kotlin.dsl.configure 8 | import org.gradle.kotlin.dsl.dependencies 9 | import org.gradle.kotlin.dsl.getByType 10 | import org.gradle.kotlin.dsl.kotlin 11 | import ycharts.android.configureKotlinAndroid 12 | 13 | /** 14 | * Library convention plugin 15 | * 16 | * @constructor Create empty Library convention plugin 17 | */ 18 | class LibraryConventionPlugin : Plugin { 19 | override fun apply(target: Project) { 20 | with(target) { 21 | val libs = extensions.getByType().named("versionCatalogLibs") 22 | with(pluginManager) { 23 | apply(libs.findPlugin("android.library").get().get().pluginId) 24 | apply(libs.findPlugin("kotlin.android").get().get().pluginId) 25 | } 26 | 27 | extensions.configure { 28 | configureKotlinAndroid(this) 29 | defaultConfig.targetSdk = 33 30 | } 31 | 32 | dependencies { 33 | add("implementation", libs.findLibrary("coroutine").get()) 34 | add("testImplementation", kotlin("test")) 35 | add("testImplementation", libs.findBundle("coroutine.test").get()) 36 | add("testImplementation", libs.findLibrary("androidx.junit").get()) 37 | add("androidTestImplementation", libs.findLibrary("androidx.junit").get()) 38 | add("androidTestImplementation", kotlin("test")) 39 | 40 | } 41 | } 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /build-logic/src/main/java/ycharts/android/AppBuildType.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2022 The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package ycharts.android 18 | 19 | /** 20 | * This is shared between :app and :benchmarks module to provide configurations type safety. 21 | */ 22 | @Suppress("unused") 23 | enum class AppBuildType(val applicationIdSuffix: String? = null) { 24 | DEBUG(".debug"), 25 | RELEASE 26 | } 27 | -------------------------------------------------------------------------------- /build-logic/src/main/java/ycharts/android/ComposeApplication.kt: -------------------------------------------------------------------------------- 1 | package ycharts.android 2 | 3 | import com.android.build.api.dsl.CommonExtension 4 | import org.gradle.api.Project 5 | import org.gradle.api.artifacts.VersionCatalogsExtension 6 | import org.gradle.kotlin.dsl.dependencies 7 | import org.gradle.kotlin.dsl.getByType 8 | 9 | 10 | /** 11 | * Configure compose application 12 | * 13 | * @param commonExtension 14 | */ 15 | internal fun Project.configureComposeApplication( 16 | commonExtension: CommonExtension<*, *, *, *>, 17 | ) { 18 | val libs = extensions.getByType().named("versionCatalogLibs") 19 | 20 | commonExtension.apply { 21 | buildFeatures { 22 | compose = true 23 | } 24 | composeOptions { 25 | kotlinCompilerExtensionVersion = 26 | libs.findVersion("androidxComposeCompiler").get().toString() 27 | } 28 | 29 | dependencies { 30 | val bom = libs.findLibrary("androidx-compose-bom").get() 31 | add("implementation", platform(bom)) 32 | add("implementation", libs.findBundle("compose").get()) 33 | add("androidTestImplementation", platform(bom)) 34 | add("androidTestImplementation", libs.findLibrary("androidx.compose.ui.test").get()) 35 | add("debugImplementation",libs.findLibrary("androidx.compose.ui-manifest-test").get()) 36 | } 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /build-logic/src/main/java/ycharts/android/KotlinAndroid.kt: -------------------------------------------------------------------------------- 1 | package ycharts.android 2 | 3 | import com.android.build.api.dsl.CommonExtension 4 | import org.gradle.api.JavaVersion 5 | import org.gradle.api.Project 6 | import org.gradle.kotlin.dsl.provideDelegate 7 | import org.gradle.kotlin.dsl.withType 8 | import org.jetbrains.kotlin.gradle.tasks.KotlinCompile 9 | 10 | /** 11 | * Configure base Kotlin with Android options 12 | */ 13 | internal fun Project.configureKotlinAndroid( 14 | commonExtension: CommonExtension<*, *, *, *>, 15 | ) { 16 | commonExtension.apply { 17 | compileSdk = 33 18 | packagingOptions { 19 | resources { 20 | excludes += "/META-INF/{AL2.0,LGPL2.1}" 21 | excludes += "META-INF/DEPENDENCIES" 22 | excludes += "META-INF/gradle/*" 23 | excludes += "META-INF/LICENSE.*" 24 | excludes += "META-INF/LICENSE-notice.md" 25 | } 26 | } 27 | 28 | defaultConfig { 29 | minSdk = 26 30 | testHandleProfiling = true 31 | testFunctionalTest = true 32 | vectorDrawables { 33 | useSupportLibrary = true 34 | } 35 | } 36 | compileOptions { 37 | sourceCompatibility = JavaVersion.VERSION_11 38 | targetCompatibility = JavaVersion.VERSION_11 39 | } 40 | // Use withType to workaround https://youtrack.jetbrains.com/issue/KT-55947 41 | tasks.withType().configureEach { 42 | kotlinOptions { 43 | // Set JVM target to 17 44 | jvmTarget = JavaVersion.VERSION_11.toString() 45 | // Treat all Kotlin warnings as errors (disabled by default) 46 | // Override by setting warningsAsErrors=true in your ~/.gradle/gradle.properties 47 | val warningsAsErrors: String? by project 48 | allWarningsAsErrors = warningsAsErrors.toBoolean() 49 | freeCompilerArgs = freeCompilerArgs + listOf( 50 | "-opt-in=kotlin.RequiresOptIn", 51 | // Enable experimental coroutines APIs, including Flow 52 | "-opt-in=kotlinx.coroutines.ExperimentalCoroutinesApi", 53 | "-opt-in=kotlinx.coroutines.FlowPreview", 54 | "-opt-in=kotlin.Experimental", 55 | ) 56 | } 57 | } 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /build.gradle.kts: -------------------------------------------------------------------------------- 1 | buildscript { 2 | 3 | repositories { 4 | google() 5 | mavenCentral() 6 | maven { 7 | url = uri("https://plugins.gradle.org/m2/") 8 | } 9 | } 10 | 11 | dependencies { 12 | classpath(versionCatalogLibs.android.gradle.plugin) 13 | classpath(versionCatalogLibs.kotlin.gradle.plugin) 14 | classpath("org.jetbrains.kotlin:kotlin-android-extensions:1.8.20") 15 | } 16 | 17 | tasks { 18 | register("clean", Delete::class) { 19 | delete(rootProject.buildDir) 20 | } 21 | } 22 | } 23 | plugins { 24 | id("org.jetbrains.dokka") version "1.8.10" apply false 25 | } 26 | -------------------------------------------------------------------------------- /experiments/chartcontainer/.gitignore: -------------------------------------------------------------------------------- 1 | /build -------------------------------------------------------------------------------- /experiments/chartcontainer/build.gradle.kts: -------------------------------------------------------------------------------- 1 | plugins { 2 | id("ycharts.android.application") 3 | id("ycharts.android.application.compose") 4 | id("ycharts.android.test") 5 | } 6 | 7 | android { 8 | namespace = "com.app.chartcontainer" 9 | defaultConfig { 10 | applicationId = "com.app.chartcontainer" 11 | versionCode = 1 12 | versionName = "1.0" 13 | testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" 14 | vectorDrawables { 15 | useSupportLibrary = true 16 | } 17 | } 18 | 19 | buildTypes { 20 | release { 21 | isMinifyEnabled = false 22 | proguardFiles( 23 | getDefaultProguardFile("proguard-android-optimize.txt"), 24 | "proguard-rules.pro" 25 | ) 26 | } 27 | } 28 | } 29 | 30 | dependencies { 31 | implementation(project(":YChartsLib")) 32 | } 33 | -------------------------------------------------------------------------------- /experiments/chartcontainer/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # You can control the set of applied configuration files using the 3 | # proguardFiles setting in build.gradle.kts. 4 | # 5 | # For more details, see 6 | # http://developer.android.com/guide/developing/tools/proguard.html 7 | 8 | # If your project uses WebView with JS, uncomment the following 9 | # and specify the fully qualified class name to the JavaScript interface 10 | # class: 11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 12 | # public *; 13 | #} 14 | 15 | # Uncomment this to preserve the line number information for 16 | # debugging stack traces. 17 | #-keepattributes SourceFile,LineNumberTable 18 | 19 | # If you keep the line number information, uncomment this to 20 | # hide the original source file name. 21 | #-renamesourcefileattribute SourceFile 22 | -------------------------------------------------------------------------------- /experiments/chartcontainer/src/androidTest/java/com/app/chartcontainer/ExampleInstrumentedTest.kt: -------------------------------------------------------------------------------- 1 | package com.app.chartcontainer 2 | 3 | import androidx.test.platform.app.InstrumentationRegistry 4 | import androidx.test.ext.junit.runners.AndroidJUnit4 5 | 6 | import org.junit.Test 7 | import org.junit.runner.RunWith 8 | 9 | import org.junit.Assert.* 10 | 11 | /** 12 | * Instrumented test, which will execute on an Android device. 13 | * 14 | * See [testing documentation](http://d.android.com/tools/testing). 15 | */ 16 | @RunWith(AndroidJUnit4::class) 17 | class ExampleInstrumentedTest { 18 | @Test 19 | fun useAppContext() { 20 | // Context of the app under test. 21 | val appContext = InstrumentationRegistry.getInstrumentation().targetContext 22 | assertEquals("com.app.chartcontainer", appContext.packageName) 23 | } 24 | } -------------------------------------------------------------------------------- /experiments/chartcontainer/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 12 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /experiments/chartcontainer/src/main/java/com/app/chartcontainer/LineChartActivity.kt: -------------------------------------------------------------------------------- 1 | package com.app.chartcontainer 2 | 3 | import android.os.Bundle 4 | import androidx.activity.ComponentActivity 5 | import androidx.activity.compose.setContent 6 | import androidx.compose.foundation.background 7 | import androidx.compose.foundation.layout.* 8 | import androidx.compose.material.MaterialTheme 9 | import androidx.compose.material.Surface 10 | import androidx.compose.ui.Modifier 11 | import androidx.compose.ui.graphics.Color 12 | import androidx.compose.ui.unit.dp 13 | import co.yml.charts.axis.AxisData 14 | import com.app.chartcontainer.ui.theme.YChartsTheme 15 | import co.yml.charts.ui.linechart.LineChart 16 | import co.yml.charts.common.utils.DataUtils 17 | import co.yml.charts.ui.linechart.model.IntersectionPoint 18 | import co.yml.charts.ui.linechart.model.Line 19 | import co.yml.charts.ui.linechart.model.LineChartData 20 | import co.yml.charts.ui.linechart.model.LinePlotData 21 | import co.yml.charts.ui.linechart.model.LineStyle 22 | import co.yml.charts.ui.linechart.model.SelectionHighlightPoint 23 | import co.yml.charts.ui.linechart.model.SelectionHighlightPopUp 24 | import co.yml.charts.ui.linechart.model.ShadowUnderLine 25 | 26 | 27 | class LineChartActivity : ComponentActivity() { 28 | override fun onCreate(savedInstanceState: Bundle?) { 29 | super.onCreate(savedInstanceState) 30 | setContent { 31 | YChartsTheme { 32 | // A surface container using the 'background' color from the theme 33 | Surface( 34 | modifier = Modifier, 35 | color = MaterialTheme.colors.background 36 | ) { 37 | Column( 38 | modifier = Modifier 39 | .fillMaxSize() 40 | .background(Color.Yellow), 41 | verticalArrangement = Arrangement.Center 42 | ) { 43 | val pointsData = DataUtils.getLineChartData(100, maxRange = 100) 44 | val xAxisData = AxisData.Builder() 45 | .axisStepSize(30.dp) 46 | .steps(pointsData.size -1) 47 | .labelData { i -> i.toString() } 48 | .build() 49 | val yAxisData = AxisData.Builder() 50 | .steps(5) 51 | .labelData { i -> (i * 20).toString() } 52 | .build() 53 | val data = LineChartData( 54 | LinePlotData( 55 | lines = listOf( 56 | Line( 57 | dataPoints = pointsData, 58 | LineStyle(), 59 | IntersectionPoint(), 60 | SelectionHighlightPoint(), 61 | ShadowUnderLine(), 62 | SelectionHighlightPopUp() 63 | ) 64 | ) 65 | ), 66 | xAxisData = xAxisData, 67 | yAxisData = yAxisData 68 | ) 69 | LineChart( 70 | modifier = Modifier 71 | .fillMaxWidth() 72 | .height(300.dp), 73 | lineChartData = data 74 | ) 75 | } 76 | } 77 | } 78 | } 79 | } 80 | } 81 | -------------------------------------------------------------------------------- /experiments/chartcontainer/src/main/java/com/app/chartcontainer/ui/theme/Color.kt: -------------------------------------------------------------------------------- 1 | package com.app.chartcontainer.ui.theme 2 | 3 | import androidx.compose.ui.graphics.Color 4 | 5 | val Purple200 = Color(0xFFBB86FC) 6 | val Purple500 = Color(0xFF6200EE) 7 | val Purple700 = Color(0xFF3700B3) 8 | val Teal200 = Color(0xFF03DAC5) -------------------------------------------------------------------------------- /experiments/chartcontainer/src/main/java/com/app/chartcontainer/ui/theme/Shape.kt: -------------------------------------------------------------------------------- 1 | package com.app.chartcontainer.ui.theme 2 | 3 | import androidx.compose.foundation.shape.RoundedCornerShape 4 | import androidx.compose.material.Shapes 5 | import androidx.compose.ui.unit.dp 6 | 7 | val Shapes = Shapes( 8 | small = RoundedCornerShape(4.dp), 9 | medium = RoundedCornerShape(4.dp), 10 | large = RoundedCornerShape(0.dp) 11 | ) -------------------------------------------------------------------------------- /experiments/chartcontainer/src/main/java/com/app/chartcontainer/ui/theme/Theme.kt: -------------------------------------------------------------------------------- 1 | package com.app.chartcontainer.ui.theme 2 | 3 | import androidx.compose.foundation.isSystemInDarkTheme 4 | import androidx.compose.material.MaterialTheme 5 | import androidx.compose.material.darkColors 6 | import androidx.compose.material.lightColors 7 | import androidx.compose.runtime.Composable 8 | 9 | private val DarkColorPalette = darkColors( 10 | primary = Purple200, 11 | primaryVariant = Purple700, 12 | secondary = Teal200 13 | ) 14 | 15 | private val LightColorPalette = lightColors( 16 | primary = Purple500, 17 | primaryVariant = Purple700, 18 | secondary = Teal200 19 | 20 | /* Other default colors to override 21 | background = Color.White, 22 | surface = Color.White, 23 | onPrimary = Color.White, 24 | onSecondary = Color.Black, 25 | onBackground = Color.Black, 26 | onSurface = Color.Black, 27 | */ 28 | ) 29 | 30 | @Composable 31 | fun YChartsTheme(darkTheme: Boolean = isSystemInDarkTheme(), content: @Composable () -> Unit) { 32 | val colors = if (darkTheme) { 33 | DarkColorPalette 34 | } else { 35 | LightColorPalette 36 | } 37 | 38 | MaterialTheme( 39 | colors = colors, 40 | typography = Typography, 41 | shapes = Shapes, 42 | content = content 43 | ) 44 | } -------------------------------------------------------------------------------- /experiments/chartcontainer/src/main/java/com/app/chartcontainer/ui/theme/Type.kt: -------------------------------------------------------------------------------- 1 | package com.app.chartcontainer.ui.theme 2 | 3 | import androidx.compose.material.Typography 4 | import androidx.compose.ui.text.TextStyle 5 | import androidx.compose.ui.text.font.FontFamily 6 | import androidx.compose.ui.text.font.FontWeight 7 | import androidx.compose.ui.unit.sp 8 | 9 | // Set of Material typography styles to start with 10 | val Typography = Typography( 11 | body1 = TextStyle( 12 | fontFamily = FontFamily.Default, 13 | fontWeight = FontWeight.Normal, 14 | fontSize = 16.sp 15 | ) 16 | /* Other default text styles to override 17 | button = TextStyle( 18 | fontFamily = FontFamily.Default, 19 | fontWeight = FontWeight.W500, 20 | fontSize = 14.sp 21 | ), 22 | caption = TextStyle( 23 | fontFamily = FontFamily.Default, 24 | fontWeight = FontWeight.Normal, 25 | fontSize = 12.sp 26 | ) 27 | */ 28 | ) -------------------------------------------------------------------------------- /experiments/chartcontainer/src/main/res/drawable-v24/ic_launcher_foreground.xml: -------------------------------------------------------------------------------- 1 | 7 | 8 | 9 | 15 | 18 | 21 | 22 | 23 | 24 | 30 | -------------------------------------------------------------------------------- /experiments/chartcontainer/src/main/res/mipmap-anydpi-v26/ic_launcher.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /experiments/chartcontainer/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /experiments/chartcontainer/src/main/res/mipmap-hdpi/ic_launcher.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeandtheory/YCharts/20b41b5fea742ca59c594d5a3e1af5af0a2aab5b/experiments/chartcontainer/src/main/res/mipmap-hdpi/ic_launcher.webp -------------------------------------------------------------------------------- /experiments/chartcontainer/src/main/res/mipmap-hdpi/ic_launcher_round.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeandtheory/YCharts/20b41b5fea742ca59c594d5a3e1af5af0a2aab5b/experiments/chartcontainer/src/main/res/mipmap-hdpi/ic_launcher_round.webp -------------------------------------------------------------------------------- /experiments/chartcontainer/src/main/res/mipmap-mdpi/ic_launcher.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeandtheory/YCharts/20b41b5fea742ca59c594d5a3e1af5af0a2aab5b/experiments/chartcontainer/src/main/res/mipmap-mdpi/ic_launcher.webp -------------------------------------------------------------------------------- /experiments/chartcontainer/src/main/res/mipmap-mdpi/ic_launcher_round.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeandtheory/YCharts/20b41b5fea742ca59c594d5a3e1af5af0a2aab5b/experiments/chartcontainer/src/main/res/mipmap-mdpi/ic_launcher_round.webp -------------------------------------------------------------------------------- /experiments/chartcontainer/src/main/res/mipmap-xhdpi/ic_launcher.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeandtheory/YCharts/20b41b5fea742ca59c594d5a3e1af5af0a2aab5b/experiments/chartcontainer/src/main/res/mipmap-xhdpi/ic_launcher.webp -------------------------------------------------------------------------------- /experiments/chartcontainer/src/main/res/mipmap-xhdpi/ic_launcher_round.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeandtheory/YCharts/20b41b5fea742ca59c594d5a3e1af5af0a2aab5b/experiments/chartcontainer/src/main/res/mipmap-xhdpi/ic_launcher_round.webp -------------------------------------------------------------------------------- /experiments/chartcontainer/src/main/res/mipmap-xxhdpi/ic_launcher.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeandtheory/YCharts/20b41b5fea742ca59c594d5a3e1af5af0a2aab5b/experiments/chartcontainer/src/main/res/mipmap-xxhdpi/ic_launcher.webp -------------------------------------------------------------------------------- /experiments/chartcontainer/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeandtheory/YCharts/20b41b5fea742ca59c594d5a3e1af5af0a2aab5b/experiments/chartcontainer/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp -------------------------------------------------------------------------------- /experiments/chartcontainer/src/main/res/mipmap-xxxhdpi/ic_launcher.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeandtheory/YCharts/20b41b5fea742ca59c594d5a3e1af5af0a2aab5b/experiments/chartcontainer/src/main/res/mipmap-xxxhdpi/ic_launcher.webp -------------------------------------------------------------------------------- /experiments/chartcontainer/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeandtheory/YCharts/20b41b5fea742ca59c594d5a3e1af5af0a2aab5b/experiments/chartcontainer/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp -------------------------------------------------------------------------------- /experiments/chartcontainer/src/main/res/values/colors.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | #FFBB86FC 4 | #FF6200EE 5 | #FF3700B3 6 | #FF03DAC5 7 | #FF018786 8 | #FF000000 9 | #FFFFFFFF 10 | -------------------------------------------------------------------------------- /experiments/chartcontainer/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | ChartContainer 3 | LineChartActivity 4 | 5 | -------------------------------------------------------------------------------- /experiments/chartcontainer/src/main/res/values/themes.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 7 | -------------------------------------------------------------------------------- /experiments/chartcontainer/src/test/java/com/app/chartcontainer/ExampleUnitTest.kt: -------------------------------------------------------------------------------- 1 | package com.app.chartcontainer 2 | 3 | import org.junit.Test 4 | 5 | import org.junit.Assert.* 6 | 7 | /** 8 | * Example local unit test, which will execute on the development machine (host). 9 | * 10 | * See [testing documentation](http://d.android.com/tools/testing). 11 | */ 12 | class ExampleUnitTest { 13 | @Test 14 | fun addition_isCorrect() { 15 | assertEquals(4, 2 + 2) 16 | } 17 | } -------------------------------------------------------------------------------- /experiments/piechartcontainer/.gitignore: -------------------------------------------------------------------------------- 1 | /build -------------------------------------------------------------------------------- /experiments/piechartcontainer/build.gradle.kts: -------------------------------------------------------------------------------- 1 | plugins { 2 | id("ycharts.android.application") 3 | id("ycharts.android.application.compose") 4 | id("ycharts.android.test") 5 | } 6 | 7 | android { 8 | namespace = "com.example.piechartcontainer" 9 | defaultConfig { 10 | applicationId = "com.example.piechartcontainer" 11 | versionCode = 1 12 | versionName = "1.0" 13 | testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" 14 | vectorDrawables { 15 | useSupportLibrary = true 16 | } 17 | } 18 | 19 | buildTypes { 20 | release { 21 | isMinifyEnabled = false 22 | proguardFiles( 23 | getDefaultProguardFile("proguard-android-optimize.txt"), 24 | "proguard-rules.pro" 25 | ) 26 | } 27 | } 28 | } 29 | 30 | dependencies { 31 | 32 | implementation(project(":YChartsLib")) 33 | } 34 | -------------------------------------------------------------------------------- /experiments/piechartcontainer/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # You can control the set of applied configuration files using the 3 | # proguardFiles setting in build.gradle. 4 | # 5 | # For more details, see 6 | # http://developer.android.com/guide/developing/tools/proguard.html 7 | 8 | # If your project uses WebView with JS, uncomment the following 9 | # and specify the fully qualified class name to the JavaScript interface 10 | # class: 11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 12 | # public *; 13 | #} 14 | 15 | # Uncomment this to preserve the line number information for 16 | # debugging stack traces. 17 | #-keepattributes SourceFile,LineNumberTable 18 | 19 | # If you keep the line number information, uncomment this to 20 | # hide the original source file name. 21 | #-renamesourcefileattribute SourceFile -------------------------------------------------------------------------------- /experiments/piechartcontainer/src/androidTest/java/com/example/piechartcontainer/ExampleInstrumentedTest.kt: -------------------------------------------------------------------------------- 1 | package com.example.piechartcontainer 2 | 3 | import androidx.test.platform.app.InstrumentationRegistry 4 | import androidx.test.ext.junit.runners.AndroidJUnit4 5 | 6 | import org.junit.Test 7 | import org.junit.runner.RunWith 8 | 9 | import org.junit.Assert.* 10 | 11 | /** 12 | * Instrumented test, which will execute on an Android device. 13 | * 14 | * See [testing documentation](http://d.android.com/tools/testing). 15 | */ 16 | @RunWith(AndroidJUnit4::class) 17 | class ExampleInstrumentedTest { 18 | @Test 19 | fun useAppContext() { 20 | // Context of the app under test. 21 | val appContext = InstrumentationRegistry.getInstrumentation().targetContext 22 | assertEquals("com.example.piechartcontainer", appContext.packageName) 23 | } 24 | } -------------------------------------------------------------------------------- /experiments/piechartcontainer/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 12 | 17 | 22 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | -------------------------------------------------------------------------------- /experiments/piechartcontainer/src/main/java/com/example/piechartcontainer/BarChartActivity.kt: -------------------------------------------------------------------------------- 1 | @file:OptIn(ExperimentalMaterialApi::class) 2 | 3 | package com.example.piechartcontainer 4 | 5 | import android.os.Bundle 6 | import androidx.activity.ComponentActivity 7 | import androidx.activity.compose.setContent 8 | import androidx.compose.foundation.layout.Column 9 | import androidx.compose.foundation.layout.fillMaxSize 10 | import androidx.compose.foundation.layout.height 11 | import androidx.compose.material.ExperimentalMaterialApi 12 | import androidx.compose.material.MaterialTheme 13 | import androidx.compose.material.Surface 14 | import androidx.compose.ui.Modifier 15 | import androidx.compose.ui.unit.dp 16 | import co.yml.charts.common.components.Legends 17 | import co.yml.charts.common.model.LegendsConfig 18 | import co.yml.charts.common.utils.DataUtils 19 | import co.yml.charts.common.utils.DataUtils.getGroupBarChartData 20 | import co.yml.charts.ui.barchart.GroupBarChart 21 | import co.yml.charts.ui.barchart.models.BarPlotData 22 | import co.yml.charts.ui.barchart.models.GroupBarChartData 23 | import com.example.piechartcontainer.ui.theme.YChartsTheme 24 | 25 | class BarChartActivity : ComponentActivity() { 26 | override fun onCreate(savedInstanceState: Bundle?) { 27 | super.onCreate(savedInstanceState) 28 | setContent { 29 | YChartsTheme { 30 | // A surface container using the 'background' color from the theme 31 | Surface( 32 | modifier = Modifier.fillMaxSize(), 33 | color = MaterialTheme.colors.background 34 | ) { 35 | val barSize = 3 36 | val groupBarData = getGroupBarChartData(50, 50, barSize) 37 | val colorPaletteList = DataUtils.getColorPaletteList(barSize) 38 | val groupBarPlotData = BarPlotData( 39 | groupBarList = groupBarData, 40 | barColorPaletteList = colorPaletteList 41 | ) 42 | val yStepSize = 10 43 | val xAxisData = co.yml.charts.axis.AxisData.Builder() 44 | .axisStepSize(30.dp) 45 | .steps(groupBarData.size - 1) 46 | .bottomPadding(10.dp) 47 | .labelData { index -> groupBarData[index].label } 48 | .build() 49 | val yAxisData = co.yml.charts.axis.AxisData.Builder() 50 | .steps(yStepSize) 51 | .labelAndAxisLinePadding(20.dp) 52 | .axisOffset(20.dp) 53 | .labelData { index -> (index * (50 / yStepSize)).toString() } 54 | .build() 55 | val legendsConfig = LegendsConfig( 56 | DataUtils.getLegendsLabelData(colorPaletteList), 57 | gridColumnCount = 3 58 | ) 59 | val groupBarChartData = GroupBarChartData( 60 | barPlotData = groupBarPlotData, 61 | xAxisData = xAxisData, 62 | yAxisData = yAxisData 63 | ) 64 | Column { 65 | GroupBarChart( 66 | modifier = Modifier 67 | .height(400.dp), 68 | groupBarChartData = groupBarChartData 69 | ) 70 | Legends(legendsConfig = legendsConfig) 71 | } 72 | } 73 | } 74 | } 75 | } 76 | } -------------------------------------------------------------------------------- /experiments/piechartcontainer/src/main/java/com/example/piechartcontainer/ChartContainer.kt: -------------------------------------------------------------------------------- 1 | package com.example.piechartcontainer 2 | 3 | import androidx.compose.foundation.layout.Column 4 | import androidx.compose.foundation.layout.Spacer 5 | import androidx.compose.foundation.layout.height 6 | import androidx.compose.runtime.Composable 7 | import androidx.compose.ui.Modifier 8 | import androidx.compose.ui.graphics.Color 9 | import androidx.compose.ui.unit.dp 10 | import co.yml.charts.common.model.PlotType 11 | import co.yml.charts.ui.piechart.ChartWrapper.DrawChart 12 | import co.yml.charts.ui.piechart.models.PieChartConfig 13 | import co.yml.charts.ui.piechart.models.PieChartData 14 | 15 | @Composable 16 | fun ChartContainer() { 17 | Column() { 18 | 19 | val pieChartData = PieChartData( 20 | slices = listOf( 21 | PieChartData.Slice("Mango", 15f, Color(0xFF58BDFF)), 22 | PieChartData.Slice("Banana", 35f, Color(0xFF125B7F)), 23 | PieChartData.Slice("Apple", 40f, Color(0xFF092D40)), 24 | ), 25 | plotType = PlotType.Pie 26 | ) 27 | 28 | val pieChartConfig = 29 | PieChartConfig( 30 | labelVisible = true, 31 | strokeWidth = 120f, 32 | labelColor = Color.Black 33 | ) 34 | 35 | 36 | DrawChart( 37 | modifier = Modifier.height(350.dp), 38 | pieChartData = pieChartData, 39 | plotType = PlotType.Pie, 40 | pieChartConfig = pieChartConfig 41 | ) 42 | Spacer(modifier = Modifier.height(32.dp)) 43 | DrawChart( 44 | modifier = Modifier.height(350.dp), 45 | pieChartData = pieChartData, 46 | plotType = PlotType.Donut, 47 | pieChartConfig = pieChartConfig 48 | ) 49 | } 50 | 51 | } 52 | -------------------------------------------------------------------------------- /experiments/piechartcontainer/src/main/java/com/example/piechartcontainer/MainActivity.kt: -------------------------------------------------------------------------------- 1 | package com.example.piechartcontainer 2 | 3 | import android.content.Intent 4 | import android.os.Bundle 5 | import androidx.activity.ComponentActivity 6 | import androidx.activity.compose.setContent 7 | import androidx.compose.foundation.layout.* 8 | import androidx.compose.material.Button 9 | import androidx.compose.material.MaterialTheme 10 | import androidx.compose.material.Surface 11 | import androidx.compose.material.Text 12 | import androidx.compose.runtime.Composable 13 | import androidx.compose.ui.Modifier 14 | import androidx.compose.ui.tooling.preview.Preview 15 | import androidx.compose.ui.unit.dp 16 | import com.example.piechartcontainer.ui.theme.YChartsTheme 17 | 18 | class MainActivity : ComponentActivity() { 19 | override fun onCreate(savedInstanceState: Bundle?) { 20 | super.onCreate(savedInstanceState) 21 | setContent { 22 | YChartsTheme { 23 | // A surface container using the 'background' color from the theme 24 | Surface( 25 | modifier = Modifier, 26 | color = MaterialTheme.colors.background 27 | ) { 28 | Column { 29 | Spacer(modifier = Modifier.height(10.dp)) 30 | Text(text = "Charts") 31 | Spacer(modifier = Modifier.height(10.dp)) 32 | Button(modifier = Modifier 33 | .padding(5.dp) 34 | .fillMaxWidth(), onClick = { 35 | startActivity( 36 | Intent( 37 | this@MainActivity, 38 | BarChartActivity::class.java 39 | ) 40 | ) 41 | }) { 42 | Text(text = "Bar Chart") 43 | } 44 | Spacer(modifier = Modifier.height(10.dp)) 45 | Button(modifier = Modifier 46 | .padding(5.dp) 47 | .fillMaxWidth(), onClick = { 48 | startActivity( 49 | Intent( 50 | this@MainActivity, 51 | PieChartActivity::class.java 52 | ) 53 | ) 54 | }) { 55 | Text(text = "Pie Chart") 56 | } 57 | } 58 | } 59 | } 60 | } 61 | } 62 | } 63 | 64 | @Composable 65 | fun Greeting(name: String) { 66 | Text(text = "Hello $name!") 67 | } 68 | 69 | @Preview(showBackground = true) 70 | @Composable 71 | fun DefaultPreview() { 72 | YChartsTheme { 73 | Greeting("Android") 74 | } 75 | } 76 | -------------------------------------------------------------------------------- /experiments/piechartcontainer/src/main/java/com/example/piechartcontainer/PieChartActivity.kt: -------------------------------------------------------------------------------- 1 | package com.example.piechartcontainer 2 | 3 | import android.graphics.Typeface 4 | import android.os.Bundle 5 | import android.text.TextUtils 6 | import android.widget.Toast 7 | import androidx.activity.ComponentActivity 8 | import androidx.activity.compose.setContent 9 | import androidx.compose.foundation.layout.Column 10 | import androidx.compose.foundation.layout.fillMaxSize 11 | import androidx.compose.foundation.layout.fillMaxWidth 12 | import androidx.compose.foundation.layout.height 13 | import androidx.compose.material.MaterialTheme 14 | import androidx.compose.material.Surface 15 | import androidx.compose.ui.Modifier 16 | import androidx.compose.ui.graphics.Color 17 | import androidx.compose.ui.platform.LocalContext 18 | import androidx.compose.ui.unit.dp 19 | import co.yml.charts.common.components.Legends 20 | import co.yml.charts.common.model.PlotType 21 | import co.yml.charts.common.utils.DataUtils 22 | import co.yml.charts.ui.piechart.charts.PieChart 23 | import co.yml.charts.ui.piechart.models.PieChartConfig 24 | import co.yml.charts.ui.piechart.models.PieChartData 25 | import com.example.piechartcontainer.ui.theme.YChartsTheme 26 | 27 | class PieChartActivity : ComponentActivity() { 28 | override fun onCreate(savedInstanceState: Bundle?) { 29 | super.onCreate(savedInstanceState) 30 | setContent { 31 | YChartsTheme { 32 | // A surface container using the 'background' color from the theme 33 | Surface( 34 | modifier = Modifier.fillMaxSize(), 35 | color = MaterialTheme.colors.background 36 | ) { 37 | val context = LocalContext.current 38 | 39 | val pieChartData = PieChartData( 40 | slices = listOf( 41 | PieChartData.Slice("MI", 15f, Color(0xFF58BDFF)), 42 | PieChartData.Slice("Iphone", 35f, Color(0xFF125B7F)), 43 | PieChartData.Slice("Windows", 10f, Color(0xFF092D40)), 44 | PieChartData.Slice("Pixel", 10f, Color(0xFF092D10)), 45 | PieChartData.Slice("Samsung", 20f, Color(0xFF092D70)), 46 | PieChartData.Slice("Oneplus", 0f, Color(0xFF092D80)), 47 | ), 48 | plotType = PlotType.Pie 49 | ) 50 | 51 | val pieChartConfig = 52 | PieChartConfig( 53 | labelVisible = true, 54 | strokeWidth = 120f, 55 | labelColor = Color.Black, 56 | activeSliceAlpha = .9f, 57 | isEllipsizeEnabled = true, 58 | sliceLabelEllipsizeAt = TextUtils.TruncateAt.MIDDLE, 59 | labelTypeface = Typeface.defaultFromStyle(Typeface.BOLD), 60 | isAnimationEnable = true, 61 | showSliceLabels = true, 62 | chartPadding = 25, 63 | ) 64 | Column { 65 | Legends( 66 | legendsConfig = DataUtils.getLegendsConfigFromPieChartData( 67 | pieChartData, 68 | 3 69 | ) 70 | ) 71 | PieChart( 72 | modifier = Modifier 73 | .fillMaxWidth() 74 | .height(500.dp), 75 | pieChartData, 76 | pieChartConfig 77 | ) { slice -> 78 | Toast.makeText(context, slice.label, Toast.LENGTH_SHORT).show() 79 | } 80 | } 81 | } 82 | } 83 | } 84 | } 85 | } 86 | -------------------------------------------------------------------------------- /experiments/piechartcontainer/src/main/java/com/example/piechartcontainer/ui/theme/Color.kt: -------------------------------------------------------------------------------- 1 | package com.example.piechartcontainer.ui.theme 2 | 3 | import androidx.compose.ui.graphics.Color 4 | 5 | val Purple200 = Color(0xFFBB86FC) 6 | val Purple500 = Color(0xFF6200EE) 7 | val Purple700 = Color(0xFF3700B3) 8 | val Teal200 = Color(0xFF03DAC5) -------------------------------------------------------------------------------- /experiments/piechartcontainer/src/main/java/com/example/piechartcontainer/ui/theme/Shape.kt: -------------------------------------------------------------------------------- 1 | package com.example.piechartcontainer.ui.theme 2 | 3 | import androidx.compose.foundation.shape.RoundedCornerShape 4 | import androidx.compose.material.Shapes 5 | import androidx.compose.ui.unit.dp 6 | 7 | val Shapes = Shapes( 8 | small = RoundedCornerShape(4.dp), 9 | medium = RoundedCornerShape(4.dp), 10 | large = RoundedCornerShape(0.dp) 11 | ) -------------------------------------------------------------------------------- /experiments/piechartcontainer/src/main/java/com/example/piechartcontainer/ui/theme/Theme.kt: -------------------------------------------------------------------------------- 1 | package com.example.piechartcontainer.ui.theme 2 | 3 | import androidx.compose.foundation.isSystemInDarkTheme 4 | import androidx.compose.material.MaterialTheme 5 | import androidx.compose.material.darkColors 6 | import androidx.compose.material.lightColors 7 | import androidx.compose.runtime.Composable 8 | 9 | private val DarkColorPalette = darkColors( 10 | primary = Purple200, 11 | primaryVariant = Purple700, 12 | secondary = Teal200 13 | ) 14 | 15 | private val LightColorPalette = lightColors( 16 | primary = Purple500, 17 | primaryVariant = Purple700, 18 | secondary = Teal200 19 | 20 | /* Other default colors to override 21 | background = Color.White, 22 | surface = Color.White, 23 | onPrimary = Color.White, 24 | onSecondary = Color.Black, 25 | onBackground = Color.Black, 26 | onSurface = Color.Black, 27 | */ 28 | ) 29 | 30 | @Composable 31 | fun YChartsTheme(darkTheme: Boolean = isSystemInDarkTheme(), content: @Composable () -> Unit) { 32 | val colors = if (darkTheme) { 33 | DarkColorPalette 34 | } else { 35 | LightColorPalette 36 | } 37 | 38 | MaterialTheme( 39 | colors = colors, 40 | typography = Typography, 41 | shapes = Shapes, 42 | content = content 43 | ) 44 | } -------------------------------------------------------------------------------- /experiments/piechartcontainer/src/main/java/com/example/piechartcontainer/ui/theme/Type.kt: -------------------------------------------------------------------------------- 1 | package com.example.piechartcontainer.ui.theme 2 | 3 | import androidx.compose.material.Typography 4 | import androidx.compose.ui.text.TextStyle 5 | import androidx.compose.ui.text.font.FontFamily 6 | import androidx.compose.ui.text.font.FontWeight 7 | import androidx.compose.ui.unit.sp 8 | 9 | // Set of Material typography styles to start with 10 | val Typography = Typography( 11 | body1 = TextStyle( 12 | fontFamily = FontFamily.Default, 13 | fontWeight = FontWeight.Normal, 14 | fontSize = 16.sp 15 | ) 16 | ) 17 | -------------------------------------------------------------------------------- /experiments/piechartcontainer/src/main/res/drawable-v24/ic_launcher_foreground.xml: -------------------------------------------------------------------------------- 1 | 7 | 8 | 9 | 15 | 18 | 21 | 22 | 23 | 24 | 30 | -------------------------------------------------------------------------------- /experiments/piechartcontainer/src/main/res/mipmap-anydpi-v26/ic_launcher.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /experiments/piechartcontainer/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /experiments/piechartcontainer/src/main/res/mipmap-hdpi/ic_launcher.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeandtheory/YCharts/20b41b5fea742ca59c594d5a3e1af5af0a2aab5b/experiments/piechartcontainer/src/main/res/mipmap-hdpi/ic_launcher.webp -------------------------------------------------------------------------------- /experiments/piechartcontainer/src/main/res/mipmap-hdpi/ic_launcher_round.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeandtheory/YCharts/20b41b5fea742ca59c594d5a3e1af5af0a2aab5b/experiments/piechartcontainer/src/main/res/mipmap-hdpi/ic_launcher_round.webp -------------------------------------------------------------------------------- /experiments/piechartcontainer/src/main/res/mipmap-mdpi/ic_launcher.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeandtheory/YCharts/20b41b5fea742ca59c594d5a3e1af5af0a2aab5b/experiments/piechartcontainer/src/main/res/mipmap-mdpi/ic_launcher.webp -------------------------------------------------------------------------------- /experiments/piechartcontainer/src/main/res/mipmap-mdpi/ic_launcher_round.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeandtheory/YCharts/20b41b5fea742ca59c594d5a3e1af5af0a2aab5b/experiments/piechartcontainer/src/main/res/mipmap-mdpi/ic_launcher_round.webp -------------------------------------------------------------------------------- /experiments/piechartcontainer/src/main/res/mipmap-xhdpi/ic_launcher.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeandtheory/YCharts/20b41b5fea742ca59c594d5a3e1af5af0a2aab5b/experiments/piechartcontainer/src/main/res/mipmap-xhdpi/ic_launcher.webp -------------------------------------------------------------------------------- /experiments/piechartcontainer/src/main/res/mipmap-xhdpi/ic_launcher_round.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeandtheory/YCharts/20b41b5fea742ca59c594d5a3e1af5af0a2aab5b/experiments/piechartcontainer/src/main/res/mipmap-xhdpi/ic_launcher_round.webp -------------------------------------------------------------------------------- /experiments/piechartcontainer/src/main/res/mipmap-xxhdpi/ic_launcher.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeandtheory/YCharts/20b41b5fea742ca59c594d5a3e1af5af0a2aab5b/experiments/piechartcontainer/src/main/res/mipmap-xxhdpi/ic_launcher.webp -------------------------------------------------------------------------------- /experiments/piechartcontainer/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeandtheory/YCharts/20b41b5fea742ca59c594d5a3e1af5af0a2aab5b/experiments/piechartcontainer/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp -------------------------------------------------------------------------------- /experiments/piechartcontainer/src/main/res/mipmap-xxxhdpi/ic_launcher.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeandtheory/YCharts/20b41b5fea742ca59c594d5a3e1af5af0a2aab5b/experiments/piechartcontainer/src/main/res/mipmap-xxxhdpi/ic_launcher.webp -------------------------------------------------------------------------------- /experiments/piechartcontainer/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeandtheory/YCharts/20b41b5fea742ca59c594d5a3e1af5af0a2aab5b/experiments/piechartcontainer/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp -------------------------------------------------------------------------------- /experiments/piechartcontainer/src/main/res/values/colors.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | #FFBB86FC 4 | #FF6200EE 5 | #FF3700B3 6 | #FF03DAC5 7 | #FF018786 8 | #FF000000 9 | #FFFFFFFF 10 | -------------------------------------------------------------------------------- /experiments/piechartcontainer/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | piechartcontainer 3 | PieChartActivity 4 | BarChartActivity 5 | -------------------------------------------------------------------------------- /experiments/piechartcontainer/src/main/res/values/themes.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 7 | -------------------------------------------------------------------------------- /experiments/piechartcontainer/src/test/java/com/example/piechartcontainer/ExampleUnitTest.kt: -------------------------------------------------------------------------------- 1 | package com.example.piechartcontainer 2 | 3 | import org.junit.Test 4 | 5 | import org.junit.Assert.* 6 | 7 | /** 8 | * Example local unit test, which will execute on the development machine (host). 9 | * 10 | * See [testing documentation](http://d.android.com/tools/testing). 11 | */ 12 | class ExampleUnitTest { 13 | @Test 14 | fun addition_isCorrect() { 15 | assertEquals(4, 2 + 2) 16 | } 17 | } -------------------------------------------------------------------------------- /gradle.properties: -------------------------------------------------------------------------------- 1 | # Project-wide Gradle settings. 2 | # IDE (e.g. Android Studio) users: 3 | # Gradle settings configured through the IDE *will override* 4 | # any settings specified in this file. 5 | # For more details on how to configure your build environment visit 6 | # http://www.gradle.org/docs/current/userguide/build_environment.html 7 | # Specifies the JVM arguments used for the daemon process. 8 | # The setting is particularly useful for tweaking memory settings. 9 | org.gradle.jvmargs=-Xmx2048m -Dfile.encoding=UTF-8 10 | # When configured, Gradle will run in incubating parallel mode. 11 | # This option should only be used with decoupled projects. More details, visit 12 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects 13 | # org.gradle.parallel=true 14 | # AndroidX package structure to make it clearer which packages are bundled with the 15 | # Android operating system, and which are packaged with your app"s APK 16 | # https://developer.android.com/topic/libraries/support-library/androidx-rn 17 | android.useAndroidX=true 18 | # Kotlin code style for this project: "official" or "obsolete": 19 | kotlin.code.style=official 20 | # Enables namespacing of each library's R class so that its R class includes only the 21 | # resources declared in the library itself and none from the library's dependencies, 22 | # thereby reducing the size of the R class for that library 23 | android.nonTransitiveRClass=true -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeandtheory/YCharts/20b41b5fea742ca59c594d5a3e1af5af0a2aab5b/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Sat Apr 01 05:16:59 IST 2023 2 | distributionBase=GRADLE_USER_HOME 3 | distributionUrl=https\://services.gradle.org/distributions/gradle-8.0-bin.zip 4 | networkTimeout=10000 5 | distributionPath=wrapper/dists 6 | zipStorePath=wrapper/dists 7 | zipStoreBase=GRADLE_USER_HOME 8 | 9 | -------------------------------------------------------------------------------- /gradlew.bat: -------------------------------------------------------------------------------- 1 | @rem 2 | @rem Copyright 2015 the original author or authors. 3 | @rem 4 | @rem Licensed under the Apache License, Version 2.0 (the "License"); 5 | @rem you may not use this file except in compliance with the License. 6 | @rem You may obtain a copy of the License at 7 | @rem 8 | @rem https://www.apache.org/licenses/LICENSE-2.0 9 | @rem 10 | @rem Unless required by applicable law or agreed to in writing, software 11 | @rem distributed under the License is distributed on an "AS IS" BASIS, 12 | @rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | @rem See the License for the specific language governing permissions and 14 | @rem limitations under the License. 15 | @rem 16 | 17 | @if "%DEBUG%" == "" @echo off 18 | @rem ########################################################################## 19 | @rem 20 | @rem Gradle startup script for Windows 21 | @rem 22 | @rem ########################################################################## 23 | 24 | @rem Set local scope for the variables with windows NT shell 25 | if "%OS%"=="Windows_NT" setlocal 26 | 27 | set DIRNAME=%~dp0 28 | if "%DIRNAME%" == "" set DIRNAME=. 29 | set APP_BASE_NAME=%~n0 30 | set APP_HOME=%DIRNAME% 31 | 32 | @rem Resolve any "." and ".." in APP_HOME to make it shorter. 33 | for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi 34 | 35 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 36 | set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" 37 | 38 | @rem Find java.exe 39 | if defined JAVA_HOME goto findJavaFromJavaHome 40 | 41 | set JAVA_EXE=java.exe 42 | %JAVA_EXE% -version >NUL 2>&1 43 | if "%ERRORLEVEL%" == "0" goto execute 44 | 45 | echo. 46 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 47 | echo. 48 | echo Please set the JAVA_HOME variable in your environment to match the 49 | echo location of your Java installation. 50 | 51 | goto fail 52 | 53 | :findJavaFromJavaHome 54 | set JAVA_HOME=%JAVA_HOME:"=% 55 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 56 | 57 | if exist "%JAVA_EXE%" goto execute 58 | 59 | echo. 60 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 61 | echo. 62 | echo Please set the JAVA_HOME variable in your environment to match the 63 | echo location of your Java installation. 64 | 65 | goto fail 66 | 67 | :execute 68 | @rem Setup the command line 69 | 70 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 71 | 72 | 73 | @rem Execute Gradle 74 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* 75 | 76 | :end 77 | @rem End local scope for the variables with windows NT shell 78 | if "%ERRORLEVEL%"=="0" goto mainEnd 79 | 80 | :fail 81 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 82 | rem the _cmd.exe /c_ return code! 83 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 84 | exit /b 1 85 | 86 | :mainEnd 87 | if "%OS%"=="Windows_NT" endlocal 88 | 89 | :omega 90 | -------------------------------------------------------------------------------- /renovate.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://docs.renovatebot.com/renovate-schema.json", 3 | "extends": [ 4 | "config:base" 5 | ], 6 | "baseBranches": [ 7 | "main" 8 | ], 9 | "packageRules": [ 10 | { 11 | "matchPackageNames": [ 12 | "org.jetbrains.kotlin:kotlin-gradle-plugin", 13 | "org.jetbrains.kotlin:kotlin-android-extensions", 14 | "org.jetbrains.kotlin:kotlin-stdlib-common", 15 | "org.jetbrains.kotlin.android", 16 | "org.jetbrains.kotlin.jvm" 17 | ], 18 | "groupName": "kotlin", 19 | "schedule": [ 20 | "on the first day of the month" 21 | ] 22 | }, { 23 | "matchPackageNames": [ 24 | "com.android.application", 25 | "com.android.library", 26 | "com.android.tools.build:gradle" 27 | ], 28 | "groupName": "android", 29 | "schedule": [ 30 | "on the first day of the month" 31 | ] 32 | }, 33 | { 34 | "matchPackageNames": [ 35 | "androidx.core:core-ktx", 36 | "androidx.lifecycle:lifecycle-runtime-ktx", 37 | "androidx.navigation:navigation-testing", 38 | "androidx.lifecycle:lifecycle-viewmodel-ktx", 39 | "androidx.core:core-ktx", 40 | "androidx.appcompat:appcompat" 41 | ], 42 | "groupName": "androidx", 43 | "schedule": [ 44 | "on the first day of the month" 45 | ] 46 | }, { 47 | "matchPackageNames": [ 48 | "androidx.activity:activity-compose", 49 | "androidx.compose:compose-bom", 50 | "androidx.compose.foundation", 51 | "androidx.compose.ui:ui-test-manifest", 52 | "androidx.compose.ui:ui-util", 53 | "androidx.compose.ui:ui-tooling", 54 | "androidx.compose.ui:ui-tooling-preview", 55 | "androidx.compose.ui:ui-test-junit4", 56 | "androidx.compose.material", 57 | "androidx.compose.material3", 58 | "androidx.compose.material3:material3-window-size-class", 59 | "androidx.compose.runtime:runtime", 60 | "androidx.compose.runtime:runtime-livedata", 61 | "androidx.navigation:navigation-compose", 62 | "androidx.lifecycle:lifecycle-viewmodel-compose" 63 | ], 64 | "groupName": "androidxCompose", 65 | "schedule": [ 66 | "on the first day of the month" 67 | ] 68 | }, 69 | { 70 | "matchPackageNames": [ 71 | "org.jetbrains.kotlin:kotlin-test-common", 72 | "com.android.test", 73 | "androidx.test:runner", 74 | "androidx.test:core", 75 | "androidx.test:core-ktx", 76 | "androidx.test.espresso:espresso-core", 77 | "androidx.test.ext:junit", 78 | "androidx.test.ext:junit-ktx", 79 | "androidx.test:rules", 80 | "androidx.test:monitor", 81 | "io.mockk:mockk-android", 82 | "androidx.annotation:annotation", 83 | "org.junit.jupiter:junit-jupiter" 84 | ], 85 | "groupName": "test", 86 | "schedule": [ 87 | "on the first day of the month" 88 | ] 89 | }, { 90 | "matchPackageNames": [ 91 | "org.jetbrains.kotlinx:kotlinx-coroutines-core", 92 | "org.jetbrains.kotlinx:kotlinx-coroutines-android", 93 | "org.jetbrains.kotlinx:kotlinx-coroutines-test", 94 | "app.cash.turbine:turbine", 95 | "androidx.test:core-ktx" 96 | ], 97 | "groupName": "coroutine", 98 | "schedule": [ 99 | "on the first day of the month" 100 | ] 101 | } ,{ 102 | "matchPackageNames": [ 103 | "org.jlleitschuh.gradle.ktlint", 104 | "org.jetbrains.dokka", 105 | "org.sonarqube", 106 | "org.jetbrains.dokka:dokka-gradle-plugin", 107 | "androidx.test:core-ktx" 108 | ], 109 | "groupName": "others", 110 | "schedule": [ 111 | "on the first day of the month" 112 | ] 113 | } 114 | ], 115 | "ignoreDeps": [ 116 | "org.jetbrains.kotlin:kotlin-gradle-plugin", 117 | "androidx.annotation:annotation", 118 | "androidx.test.core-ktx", 119 | "androidx.test.core" 120 | ] 121 | } -------------------------------------------------------------------------------- /settings.gradle.kts: -------------------------------------------------------------------------------- 1 | pluginManagement { 2 | includeBuild("build-logic") 3 | repositories { 4 | gradlePluginPortal() 5 | google() 6 | mavenCentral() 7 | } 8 | } 9 | dependencyResolutionManagement { 10 | repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS) 11 | repositories { 12 | google() 13 | mavenCentral() 14 | maven("https://kotlin.bintray.com/kotlinx") 15 | } 16 | versionCatalogs { 17 | create("versionCatalogLibs") { 18 | from(files("./gradle/libs.versions.toml")) 19 | } 20 | } 21 | } 22 | rootProject.name = "YCharts" 23 | include( 24 | ":app", 25 | ":YChartsLib", 26 | ":experiments:chartcontainer", 27 | ":experiments:piechartcontainer" 28 | ) 29 | --------------------------------------------------------------------------------