Plot
An android compose library with different Graphs and Charts
Install / Use
/learn @Madrapps/PlotREADME
plot
An android compose library with different Graphs and Charts (currently supports only Line graph, more types will be added soon)
<img src="/preview/line_graph_recording.gif" alt="Line Graph 1" width="600"/><img src="/preview/line_graph_1.png" alt="Line Graph 1" title="Line Graph 1" width="400"/> <img src="/preview/line_graph_2.png" alt="Line Graph 2" title="Line Graph 2" width="400"/> <img src="/preview/line_graph_3.png" alt="Line Graph 3" title="Line Graph 3" width="400" /> <img src="/preview/line_graph_4.png" alt="Line Graph 4" title="Line Graph 4" width="400" />
Download
repositories {
mavenCentral()
}
dependencies {
implementation 'com.github.madrapps:plot:0.1.1'
}
Features
- Full customization of the various parts of the graph (like the point, line between the points, highlight when selected, the values in x-axis and y-axis, etc...)
- Supports scrolling, zooming and touch drag selection
Usage
Just add the LineGraph composable and pass it a LinePlot with all your configuration and customisation.
Please take a look at the sample app to see the various
customisations available. Almost every aspect of the graph is customisable. You can even override the default
draw implementations and can draw a Rectangle instead of a Circle, etc. The below code renders the Orange
graph that you see in the above screenshots.
@Composable
fun SampleLineGraph(lines: List<List<DataPoint>>) {
LineGraph(
plot = LinePlot(
listOf(
LinePlot.Line(
lines[0],
LinePlot.Connection(color = Red300),
LinePlot.Intersection(color = Red500),
LinePlot.Highlight(color = Yellow700),
)
),
grid = LinePlot.Grid(Red100, steps = 4),
),
modifier = Modifier.fillMaxWidth().height(200.dp),
onSelection = { xLine, points ->
// Do whatever you want here
}
)
}
License
plot by Madrapps is licensed under the Apache License 2.0.
Related Skills
node-connect
346.8kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
107.6kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
346.8kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
qqbot-media
346.8kQQBot 富媒体收发能力。使用 <qqmedia> 标签,系统根据文件扩展名自动识别类型(图片/语音/视频/文件)。
