GithubHelp home page GithubHelp logo

bytebeats / compose-charts Goto Github PK

View Code? Open in Web Editor NEW
157.0 157.0 14.0 15.5 MB

Simple Jetpack Compose Charts for multi-platform. Including Android, Web, Desktop.

License: MIT License

Kotlin 100.00%
bar-chart charts compose jetpack jetpack-compose line-chart pie-chart

compose-charts's Introduction


trophy
Top Langs
bytebeats's GitHub stats

compose-charts's People

Contributors

bytebeats avatar crizzis avatar leinardi avatar mek101 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

compose-charts's Issues

Custom Labels for numeric values on Y-Axis

I would like to replace the labels on the y-axis in a bar diagram while keeping the original structure.
In my use case, I display an amount of time per day of week, which is currently displayed in minutes, but I'd like to change the format to something like 2:30 instead of 150. Is there an option for that?

Expose LineChartData's properties to public

Hi ๐Ÿ‘‹ Firstly, I wanna say thank you for your helpful compose chart library. You saved me a lot of time to implement the LineChart on my current project.

I am using LineChart from your library however the design looks a bit different from yours, that's why I have do to some stuff to customize the chart. I need to determine the max and min values to draw the text label on top of the points. So I am asking for the solution that we could expose the properties to public rather than private/internal ๐Ÿ˜„

private val yMinMaxValues: Pair<Float, Float>
get() {
val minValue = points.minOf { it.value }
val maxValue = points.maxOf { it.value }
return minValue to maxValue
}
internal val maxY: Float
get() = yMinMaxValues.second + (yMinMaxValues.second - yMinMaxValues.first) * padBy / 100F
internal val minY: Float
get() = if (startAtZero) 0F else yMinMaxValues.first - (yMinMaxValues.second - yMinMaxValues.first) * padBy / 100F
internal val yRange: Float
get() = maxY - minY

Feature request: custom BarChart max value

Right now, BarChart max y value is fixed on the highest data point. It would be nice to be able to set the top y value to some other value. I have some extra markers I need to put at certain Y values beyond the top bar and I'm struggling to make it render correctly.

Typo in BarChart.kt

Hey, you have a typo in compose-charts/charts/src/main/java/me/bytebeats/views/charts/bar/BarChart.kt
The classname now is BarChar instead of BarChart.

@Preview is not working with PieChart

@Preview
@Composable
fun PieChartPreview() {
    Box(modifier = Modifier.height(150.dp)) {
        PieChart(
            pieChartData = PieChartData(
                slices = listOf(
                    PieChartData.Slice(25F, Color.Red),
                    PieChartData.Slice(45F, Color.Green),
                    PieChartData.Slice(20F, Color.Blue),
                ),
            ),
            sliceDrawer = SimpleSliceDrawer(sliceThickness = 100f)
        )
    }
}

I am using a Android Studio 2021.1.1 Patch 3, with Jetpack Compose 1.1.1
I can display the chart no problem on my device

Suggesion: X value formatter

First of all, congrats for the API, it's awesome and works like a glance.

But just like in the Y axis there's a value formatter to customize how it's displayed, it'd be really useful to have the same on the X axis.

Thanks in advance, keep working! This is awesome ๐Ÿš€

License

Could you add a license to the project?
There are open source licenses such as Apache 2.0, MIT, BSD, etc

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.