Skip to content

Instantly share code, notes, and snippets.

@sidgrio
Created January 29, 2019 18:43
Method to set how large the pie chart will be
/**
* 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