DonutModel

data class DonutModel(cap: Float, masterProgress: Float, gapWidthDegrees: Float, gapAngleDegrees: Float, strokeWidth: Float, backgroundLineColor: Color, sections: List<DonutSection>)

Wrapper for all necessary data values used by DonutProgress to draw its content.

Parameters

cap

Maximum value of sum of all entries in view, after which all lines start to resize proportionally to amounts in their entry categories.

masterProgress

Percentage of progress shown for all lines. Eg. when one line has 50% of total graph length, setting this to 0.5f will result in that line being animated to 25% of total graph length.

gapWidthDegrees

Size of gap opening in degrees. Eg. when set to 180° then the donut will result in the size that is the half-circle.

gapAngleDegrees

The angle in degrees, at which the gap will be displayed. Eg. when set to 90° then donut will be rotated by 90° clockwise.

strokeWidth

Stroke width of all lines in pixels.

backgroundLineColor

The color of the donut background line.

sections

The data used to define each section of the donut. This data should keep the same size since adding or removing of the new section is not supported yet. If the size of this list is changed then an exception will be thrown.

Constructors

Link copied to clipboard
fun DonutModel(cap: Float, masterProgress: Float = 1.0f, gapWidthDegrees: Float = 90.0f, gapAngleDegrees: Float = 90.0f, strokeWidth: Float = 30.0f, backgroundLineColor: Color = Color.LightGray, sections: List<DonutSection>)

Properties

Link copied to clipboard
val backgroundLineColor: Color
Link copied to clipboard
val cap: Float
Link copied to clipboard
val gapAngleDegrees: Float = 90.0f
Link copied to clipboard
val gapWidthDegrees: Float = 90.0f
Link copied to clipboard
val masterProgress: Float = 1.0f
Link copied to clipboard
val sections: List<DonutSection>
Link copied to clipboard
val sectionsCap: Float
Link copied to clipboard
val strokeWidth: Float = 30.0f