Skip to content

oozou/compose_graph

Repository files navigation

Compose Graph

The purpose of this repository is to explore creating re-usable graph components with compose. Some of the graph components that will be explored include: line chart, pie chart, bar chart, etc.

LINE CHART

Function Definition:

fun LineChart(
     chartData: List<Int>,
     elevation: Dp = 5.dp,
     shape: Shape = RoundedCornerShape(5.dp),
     strokeWidth: Float = 8f,
     strokeColor: Color = colorResource(id = R.color.purple_200),
     canvasHeight: Dp = 270.dp,
     modifier: Modifier = Modifier.fillMaxWidth().height(360.dp).padding(20.dp)
)

Calling the line chart composable with just the data points will cause the LineChart function to use default values for the remaining parameters.

Example:

LineChart(listOf(10, 40, 20, 30, 80, 60))

If you want to customize the line chart, you can modify the default values for the remaining parameters in the function.

Roadmap

The folliwings are the list of graph and chart type that this library could consider to support.

  1. Multiple Line Chart (with curve and legend)

Screen Shot 2565-03-24 at 11 14 05

  1. Filled Line Chart

Screen Shot 2565-03-24 at 11 16 22

  1. Bar Chart (with legend)

Screen Shot 2565-03-24 at 11 16 55 Screen Shot 2565-03-24 at 11 17 09

  1. Horizontal Bar Chart

Screen Shot 2565-03-24 at 11 17 09

  1. Pie Chart

Screen Shot 2565-03-24 at 11 17 43

  1. Redar Chart

Screen Shot 2565-03-24 at 11 20 42

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages