This is a simple chart library built with Jetpack Compose.
Inspired by: https://github.com/AppPear/ChartView
Public API: https://dautovicharis.github.io/Charts/2.0.0-SNAPSHOT/
- Animations
- M3 theme support
- Customizable chart styles
- Various data set support
- Multiplatform: Android, iOS, Desktop, Web.
commonMain.dependencies {
implementation("io.github.dautovicharis:charts:<version>")
}
dependencyResolutionManagement {
repositories {
mavenCentral()
}
}
https://central.sonatype.com/search?q=io.github.dautovicharis.charts
implementation("io.github.dautovicharis:charts-iosx64:<version>")
implementation("io.github.dautovicharis:charts-iosarm64:<version>")
implementation("io.github.dautovicharis:charts-jvm:<version>")
implementation("io.github.dautovicharis:charts-js:<version>")
implementation("io.github.dautovicharis:charts-android:<version>")
commonMain.dependencies {
implementation("io.github.dautovicharis:charts:<snapshot-version>")
}
dependencyResolutionManagement {
repositories {
maven("https://s01.oss.sonatype.org/content/repositories/snapshots")
}
}
![](https://private-user-images.githubusercontent.com/7049715/306667285-96667aad-abbc-4dd2-b623-e5edc817e897.gif?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjM4OTEwODQsIm5iZiI6MTcyMzg5MDc4NCwicGF0aCI6Ii83MDQ5NzE1LzMwNjY2NzI4NS05NjY2N2FhZC1hYmJjLTRkZDItYjYyMy1lNWVkYzgxN2U4OTcuZ2lmP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI0MDgxNyUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNDA4MTdUMTAzMzA0WiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9YTdkNGQ1ZWY2Y2M3N2M4ZjZiNWY4ZTE4MDAxZTcyYzNkODkzODQ0YWU0ODU5NGY1M2E3YjI1OWZiNDlmODk3MyZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QmYWN0b3JfaWQ9MCZrZXlfaWQ9MCZyZXBvX2lkPTAifQ.sDi2And8sbKFMrk-gqiYwz09TcRWA3u_BTDySyjph0w)
@Composable
private fun AddDefaultPieChart() {
val dataSet = ChartDataSet(
items = listOf(8.0f, 23.0f, 54.0f, 32.0f, 12.0f, 37.0f, 7.0f, 23.0f, 43.0f),
title = stringResource(id = R.string.pie_chart),
postfix = " °C"
)
PieChartView(dataSet = dataSet)
}
![](https://private-user-images.githubusercontent.com/7049715/306667519-d5c3c054-04b5-4d17-a29c-effafbb7b083.gif?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjM4OTEwODQsIm5iZiI6MTcyMzg5MDc4NCwicGF0aCI6Ii83MDQ5NzE1LzMwNjY2NzUxOS1kNWMzYzA1NC0wNGI1LTRkMTctYTI5Yy1lZmZhZmJiN2IwODMuZ2lmP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI0MDgxNyUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNDA4MTdUMTAzMzA0WiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9NTdmMzdkZjg1MWUxZGQ3MTdiMjVmMDZkNWVmZDA3NGM4MDhkZTdkMDEwNGMzZWFlYzA2N2FlMjllNzQzZDdlMCZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QmYWN0b3JfaWQ9MCZrZXlfaWQ9MCZyZXBvX2lkPTAifQ.yOu22POcueWnqkQ7uhHHqG0veNyRLiMUyo4YNVsBNmY)
@Composable
private fun AddCustomPieChart() {
val pieColors = listOf(
ColorPalette.DataColor.navyBlue,
ColorPalette.DataColor.darkBlue,
ColorPalette.DataColor.deepPurple,
ColorPalette.DataColor.magenta,
ColorPalette.DataColor.darkPink,
ColorPalette.DataColor.coral,
ColorPalette.DataColor.orange,
ColorPalette.DataColor.yellow
)
val style = PieChartDefaults.style(
borderColor = Color.White,
donutPercentage = 40f,
borderWidth = 6f,
pieColors = pieColors,
chartViewStyle = ChartViewDemoStyle.custom(width = 200.dp)
)
val dataSet = ChartDataSet(
items = listOf(60.0f, 25f, 15f, 14f, 30f, 30f, 20f, 30f),
title = stringResource(id = R.string.pie_chart),
postfix = " °C"
)
PieChartView(dataSet = dataSet, style = style)
}
![](https://private-user-images.githubusercontent.com/7049715/306668120-6fed622d-44f1-4fac-98bc-6637e91e04b6.gif?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjM4OTEwODQsIm5iZiI6MTcyMzg5MDc4NCwicGF0aCI6Ii83MDQ5NzE1LzMwNjY2ODEyMC02ZmVkNjIyZC00NGYxLTRmYWMtOThiYy02NjM3ZTkxZTA0YjYuZ2lmP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI0MDgxNyUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNDA4MTdUMTAzMzA0WiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9ZjE0Y2U0Y2E4NGVmNTg1M2EyNzc4NDc5NDIzOTM2OGZjNDFiMGFhN2E3NDZjOGM1ZTVhYzkxZTc3YjdkZmJkYyZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QmYWN0b3JfaWQ9MCZrZXlfaWQ9MCZyZXBvX2lkPTAifQ.Xn7oP1IxXzcWAWCTTDXC8R7u-MVjYuuPQ8RtMlY3EHU)
@Composable
private fun AddDefaultLineChart() {
val dataSet = ChartDataSet(
items = listOf(
8f, 23f, 54f, 32f, 12f, 37f, 7f, 23f, 43f
),
title = stringResource(id = R.string.line_chart)
)
LineChartView(dataSet = dataSet)
}
![](https://private-user-images.githubusercontent.com/7049715/306668162-a2d76189-1b62-4740-8ef0-d241af5770ae.gif?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjM4OTEwODQsIm5iZiI6MTcyMzg5MDc4NCwicGF0aCI6Ii83MDQ5NzE1LzMwNjY2ODE2Mi1hMmQ3NjE4OS0xYjYyLTQ3NDAtOGVmMC1kMjQxYWY1NzcwYWUuZ2lmP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI0MDgxNyUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNDA4MTdUMTAzMzA0WiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9MjBlZmEzZWQyMzlhNDE1MGQxYTBiNWU3MTQxNGRmMTg0ZTFiYTEzOTNiOTY5NzM5ODc4YjNlZGUyN2U4ZjZlZSZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QmYWN0b3JfaWQ9MCZrZXlfaWQ9MCZyZXBvX2lkPTAifQ.UoXLg4syxUBxZmsIMRIyLz67Gxdz1v_Ls0SdlrttzUM)
@Composable
private fun AddCustomLineChart() {
val style = LineChartDefaults.style(
lineColor = ColorPalette.DataColor.deepPurple,
pointColor = ColorPalette.DataColor.magenta,
pointSize = 9f,
bezier = false,
dragPointColor = ColorPalette.DataColor.deepPurple,
dragPointVisible = false,
dragPointSize = 8f,
dragActivePointSize = 15f,
chartViewStyle = ChartViewDemoStyle.custom(width = 200.dp)
)
val dataSet = ChartDataSet(
items = listOf(10f, 100f, 20f, 50f, 150f, 70f, 10f, 20f, 40f),
title = stringResource(id = R.string.line_chart)
)
LineChartView(dataSet = dataSet, style = style)
}
![](https://private-user-images.githubusercontent.com/7049715/306668925-3d84d832-c3f4-4af4-9c57-b2006b38147d.gif?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjM4OTEwODQsIm5iZiI6MTcyMzg5MDc4NCwicGF0aCI6Ii83MDQ5NzE1LzMwNjY2ODkyNS0zZDg0ZDgzMi1jM2Y0LTRhZjQtOWM1Ny1iMjAwNmIzODE0N2QuZ2lmP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI0MDgxNyUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNDA4MTdUMTAzMzA0WiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9MDZhY2M4ZjQ1MGE0MzdkNWJkYzc1Y2NlYTZhZGU4NDZmMjQyN2I0YjhiMmE1MTU4ZTI4YWY3ZGZjMTdkYTEzOCZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QmYWN0b3JfaWQ9MCZrZXlfaWQ9MCZyZXBvX2lkPTAifQ.w0QAK2UVJFErPJGXgm_A3TEVZmJDKIQ77Iv7P31TT90)
@Composable
private fun AddDefaultMultiLineChart() {
val items = listOf(
"Cherry St." to listOf(26000.68f, 28000.34f, 32000.57f, 45000.57f),
"Strawberry Mall" to listOf(15261.68f, 17810.34f, 40000.57f, 85000f),
"Lime Av." to listOf(4000.87f, 5000.58f, 30245.81f, 135000.58f),
"Apple Rd." to listOf(1000.87f, 9000.58f, 16544.81f, 100444.87f)
)
val dataSet = MultiChartDataSet(
items = items,
prefix = "$",
categories = listOf("Jan", "Feb", "Mar", "Apr"),
title = stringResource(id = R.string.line_chart)
)
LineChartView(
dataSet = dataSet, style = MultiLineDemoStyle.default()
)
}
![](https://private-user-images.githubusercontent.com/7049715/306668975-7a2dd09b-5c71-4ce6-a96d-5e3fd79e682f.gif?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjM4OTEwODQsIm5iZiI6MTcyMzg5MDc4NCwicGF0aCI6Ii83MDQ5NzE1LzMwNjY2ODk3NS03YTJkZDA5Yi01YzcxLTRjZTYtYTk2ZC01ZTNmZDc5ZTY4MmYuZ2lmP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI0MDgxNyUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNDA4MTdUMTAzMzA0WiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9NGQ2N2NiY2Y4Mjk4MDQ4Mzc5YWU3ZjU4Y2Q4NWM2MzI2MTE2NWI0YmY5YTQzNGZmZjc5NDZjODVkZDhmNGFjYSZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QmYWN0b3JfaWQ9MCZrZXlfaWQ9MCZyZXBvX2lkPTAifQ.R20zziXs9GTsLrrbXCZS-MCGz_GKTjEHEpuSQkYb41k)
@Composable
private fun AddCustomMultiLineChart() {
val lineColors = listOf(ColorPalette.DataColor.navyBlue, ColorPalette.DataColor.darkBlue, ColorPalette.DataColor.deepPurple, ColorPalette.DataColor.magenta)
val style = LineChartDefaults.style(
lineColors = lineColors,
dragPointVisible = false,
pointVisible = true,
pointColor = ColorPalette.DataColor.magenta,
dragPointColor = ColorPalette.DataColor.deepPurple,
chartViewStyle = ChartViewDemoStyle.custom()
)
val items = listOf(
"Cherry St." to listOf(26000.68f, 28000.34f, 32000.57f, 45000.57f),
"Strawberry Mall" to listOf(15261.68f, 17810.34f, 40000.57f, 85000f),
"Lime Av." to listOf(4000.87f, 5000.58f, 30245.81f, 135000.58f),
"Apple Rd." to listOf(1000.87f, 9000.58f, 16544.81f, 100444.87f)
)
val dataSet = MultiChartDataSet(
items = items,
prefix = "$",
categories = listOf("Jan", "Feb", "Mar", "Apr"),
title = stringResource(id = R.string.line_chart)
)
LineChartView(dataSet = dataSet, style = style)
}
![](https://private-user-images.githubusercontent.com/7049715/306669928-4de8c2be-0548-49b7-aba6-f72449c75298.gif?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjM4OTEwODQsIm5iZiI6MTcyMzg5MDc4NCwicGF0aCI6Ii83MDQ5NzE1LzMwNjY2OTkyOC00ZGU4YzJiZS0wNTQ4LTQ5YjctYWJhNi1mNzI0NDljNzUyOTguZ2lmP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI0MDgxNyUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNDA4MTdUMTAzMzA0WiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9YzY1MGFjZjU5ZDM2YmE3NTU4ZWY5YjdiZmFlMzZlNjIwOTcxZjdkNTliODI2Y2FiMmIwODhkMTJiYjJlZTliNiZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QmYWN0b3JfaWQ9MCZrZXlfaWQ9MCZyZXBvX2lkPTAifQ.9SrwJSBw8NpmD5S0wcDp4qzyjVVyd0I-9KD0b7aQpIg)
@Composable
private fun AddDefaultBarChart() {
BarChartView(
dataSet = ChartDataSet(
items = listOf(100f, 50f, 5f, 60f, -50f, 50f, 60f),
title = stringResource(id = R.string.bar_chart)
)
)
}
![](https://private-user-images.githubusercontent.com/7049715/306669956-2e8d4193-186e-4bb6-b71c-21f6bb289921.gif?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjM4OTEwODQsIm5iZiI6MTcyMzg5MDc4NCwicGF0aCI6Ii83MDQ5NzE1LzMwNjY2OTk1Ni0yZThkNDE5My0xODZlLTRiYjYtYjcxYy0yMWY2YmIyODk5MjEuZ2lmP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI0MDgxNyUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNDA4MTdUMTAzMzA0WiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9OWJlMjJiY2FmMjkwMTVmNDVlMWE1OGM5YzU4ODU4MDAwYjFiYjBmMmU0NGFjOTVmM2UyMDc3M2Y5MDBmOTMwYSZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QmYWN0b3JfaWQ9MCZrZXlfaWQ9MCZyZXBvX2lkPTAifQ.sSvVAjEprakZFh42TUHk0CGlIl04QQ4R-ihWscPT22Y)
@Composable
private fun AddCustomBarChart() {
val style = BarChartDefaults.style(
barColor = ColorPalette.DataColor.deepPurple,
space = 12.dp,
chartViewStyle = ChartViewDemoStyle.custom(width = 200.dp)
)
BarChartView(
dataSet = ChartDataSet(
items = listOf(100f, 50f, 5f, 60f, 1f, 30f, 50f, 35f, 50f, -100f),
title = stringResource(id = R.string.bar_chart)
),
style = style
)
}
![](https://private-user-images.githubusercontent.com/7049715/306670184-9b526a26-d8e9-4779-8957-208231c9f518.gif?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjM4OTEwODQsIm5iZiI6MTcyMzg5MDc4NCwicGF0aCI6Ii83MDQ5NzE1LzMwNjY3MDE4NC05YjUyNmEyNi1kOGU5LTQ3NzktODk1Ny0yMDgyMzFjOWY1MTguZ2lmP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI0MDgxNyUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNDA4MTdUMTAzMzA0WiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9Nzc2N2Y0MzJhNjQwNWM1Njc5NjAzNzc4ZTRlMTg1ZGM2ZTgzYWRlMmQ4NGEzMzgyNmU3NmRlMDhkZjliZGJmMiZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QmYWN0b3JfaWQ9MCZrZXlfaWQ9MCZyZXBvX2lkPTAifQ.w1Ed1dzqNHSMpPdygdYsxEgWc0ab9E9HzJSwIMEm9lc)
@Composable
private fun AddDefaultStackedBarChart() {
val items = listOf(
"Cherry St." to listOf(8261.68f, 8810.34f, 30000.57f),
"Strawberry Mall" to listOf(8261.68f, 8810.34f, 30000.57f),
"Lime Av." to listOf(1500.87f, 2765.58f, 33245.81f),
"Apple Rd." to listOf(5444.87f, 233.58f, 67544.81f)
)
val dataSet = MultiChartDataSet(
items = items,
prefix = "$",
categories = listOf("Jan", "Feb", "Mar"),
title = stringResource(id = R.string.bar_stacked_chart)
)
StackedBarChartView(dataSet = dataSet)
}
![](https://private-user-images.githubusercontent.com/7049715/306670224-942be853-f82b-420c-b829-a1fa431cfe57.gif?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjM4OTEwODQsIm5iZiI6MTcyMzg5MDc4NCwicGF0aCI6Ii83MDQ5NzE1LzMwNjY3MDIyNC05NDJiZTg1My1mODJiLTQyMGMtYjgyOS1hMWZhNDMxY2ZlNTcuZ2lmP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI0MDgxNyUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNDA4MTdUMTAzMzA0WiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9YjJhYjkyYTU2YjkzZGQyMTg5N2EwNjllODlhYjcyZmUwNzgyOTYwNmM3MWFjZGJjZmRhNDAwMTM2ODM0OWFlNSZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QmYWN0b3JfaWQ9MCZrZXlfaWQ9MCZyZXBvX2lkPTAifQ.vH-fmY-VIs8MDf_9_C-5Fa38kKijhZPdDgXvuhqySK4)
@Composable
private fun AddCustomStackedBarChart() {
val colors = listOf(
ColorPalette.DataColor.navyBlue,ColorPalette.DataColor.darkBlue,ColorPalette.DataColor.deepPurple
)
val style = StackedBarChartDefaults.style(
barColors = colors,
chartViewStyle = ChartViewDemoStyle.custom(width = 240.dp)
)
val items = listOf(
"Cherry St." to listOf(8261.68f, 8810.34f, 30000.57f),
"Strawberry Mall" to listOf(8261.68f, 8810.34f, 30000.57f),
"Lime Av." to listOf(1500.87f, 2765.58f, 33245.81f),
"Apple Rd." to listOf(5444.87f, 233.58f, 67544.81f)
)
val dataSet = MultiChartDataSet(
items = items,
prefix = "$",
categories = listOf("Jan", "Feb", "Mar"),
title = stringResource(id = R.string.bar_stacked_chart)
)
StackedBarChartView(dataSet = dataSet, style = style)
}
🌟 Thank you for your time! Before you start working on code, please create a new issue.