https://github.com/teddko/linechart
LineChart - A Jetpack Compose library for creating customizable line charts with smooth animations. 📊 Supports real-time data updates, 🎨 customizable styling, and 📱 responsive design. Get started easily with a simple API and enjoy smooth, interactive charts!
https://github.com/teddko/linechart
android chart compose jetpack-compose line-chart
Last synced: 2 months ago
JSON representation
LineChart - A Jetpack Compose library for creating customizable line charts with smooth animations. 📊 Supports real-time data updates, 🎨 customizable styling, and 📱 responsive design. Get started easily with a simple API and enjoy smooth, interactive charts!
- Host: GitHub
- URL: https://github.com/teddko/linechart
- Owner: TeddKo
- License: apache-2.0
- Created: 2025-02-14T06:15:50.000Z (8 months ago)
- Default Branch: master
- Last Pushed: 2025-07-11T15:34:32.000Z (3 months ago)
- Last Synced: 2025-07-19T13:30:58.816Z (3 months ago)
- Topics: android, chart, compose, jetpack-compose, line-chart
- Language: Kotlin
- Homepage:
- Size: 251 KB
- Stars: 4
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# 📈 LineChart
Jetpack Compose library for creating customizable line charts with smooth animations.# 🚀 Features
* 🎯 Smooth animations using Jetpack Compose
* 📊 Supports multiple data points and real-time updates
* 🎨 Customizable styling, axis labels, and grid lines
* 📱 Responsive and adaptive layout
![]()
# 📦 Installation
```kotlin
dependencies {
implementation("io.github.teddko:linechart:1.0.0")
}
```# 📖 Basic Usage
```kotlin
@Composable
fun LineChartDemo() {
// Create sample data points
val chartData = listOf(
ChartData(cumulativeProfit = 100.0, date = System.currentTimeMillis()),
ChartData(cumulativeProfit = 150.0, date = System.currentTimeMillis() + 86400000),
ChartData(cumulativeProfit = 130.0, date = System.currentTimeMillis() + 172800000),
ChartData(cumulativeProfit = 200.0, date = System.currentTimeMillis() + 259200000)
)val state = rememberLineChartState(
items = chartData,
maxDataPoints = 20, // Optional: limit number of points
yAxisTicksCount = 5 // Optional: number of y-axis labels
)LineChartPanel(
modifier = Modifier.fillMaxWidth(),
chartHeight = 300.dp,
state = state
)
}
```# 🎨 Customization
```kotlin
@Composable
fun CustomizedLineChart() {
val chartData = listOf(
ChartData(cumulativeProfit = 50.0, date = System.currentTimeMillis()),
ChartData(cumulativeProfit = 75.0, date = System.currentTimeMillis() + 86400000),
ChartData(cumulativeProfit = 60.0, date = System.currentTimeMillis() + 172800000),
ChartData(cumulativeProfit = 90.0, date = System.currentTimeMillis() + 259200000)
)val state = rememberLineChartState(
items = chartData,
maxDataPoints = 10, // Show maximum 10 points
yAxisTicksCount = 6, // Show 6 labels on Y-axis
scaleFactor = 10000, // Scale factor for values
strokeWidth = 3.dp // Custom line thickness
)LineChartPanel(
modifier = Modifier
.fillMaxWidth()
.padding(16.dp),
chartHeight = 400.dp, // Custom chart height
state = state
)
}
```# 🛠️ Development Environment
* **Kotlin 2.0+**
* **Android Studio Hedgehog+**
* **Jetpack Compose 1.7+**
* **Gradle Kotlin DSL applied**# 📝 License
This project is licensed under the Apache 2.0 License.