/PieChart.kt Secret
Created
January 29, 2019 18:43
Method to set how large the pie chart will be
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Sets the bounds of the pie chart | |
* | |
* @param top the top bound of the circle. top of view by default | |
* @param bottom the bottom bound of the circle. bottom of view by default | |
* @param left the left bound of the circle. half of height by default | |
* @param right the right bound of the circle. hald of height by default | |
*/ | |
private fun setCircleBounds( | |
top: Float = 0f, bottom: Float = layoutParams.height.toFloat(), | |
left: Float = (width / 2) - (layoutParams.height / 2).toFloat(), | |
right: Float = (width / 2) + (layoutParams.height / 2).toFloat() | |
) { | |
oval.top = top | |
oval.bottom = bottom | |
oval.left = left | |
oval.right = right | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment