Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DonutChart values and colors not corresponding #280

Closed
axiel7 opened this issue Aug 15, 2020 · 1 comment
Closed

DonutChart values and colors not corresponding #280

axiel7 opened this issue Aug 15, 2020 · 1 comment

Comments

@axiel7
Copy link

axiel7 commented Aug 15, 2020

I set the values and colors in the same order but when I display the donut the last 3 values are inverted, also when I set the donutTotal to the sum of all values the DonutChart still have an empty space.

`This is my code:

donutChart.donutTotal = 430F
    donutChart.donutColors = intArrayOf(
        Color.parseColor("#00c853"), // green
        Color.parseColor("#5c6bc0"), // blue
        Color.parseColor("#ffd600"), // yellow
        Color.parseColor("#d50000"), // red
        Color.parseColor("#9e9e9e") // gray
    )
    val donutSet = listOf(
        7F, // green
        346F, // blue
        13F, // yellow
        19F, // red
        45F // gray
    )
    donutChart.animation.duration = 1000L
    donutChart.animate(donutSet)`

`XML

<com.db.williamchart.view.DonutChartView
        android:id="@+id/donut_chart"
        android:layout_width="200dp"
        android:layout_height="200dp"
        app:chart_donutBackgroundColor="@android:color/transparent"
        app:chart_donutThickness="22dp"
        app:chart_donutRoundCorners="true"/>`

The result:

Screenshot_20200815-105517~2

@diogobernardino
Copy link
Owner

Just released a hotfix to tackle this issue, update your dependency to 3.7.2.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants