DonutModel

@Model()
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

DonutModel
Link copied to clipboard
fun DonutModel(cap: Float, masterProgress: Float = 1f, gapWidthDegrees: Float = 90f, gapAngleDegrees: Float = 90f, strokeWidth: Float = 30f, backgroundLineColor: Color = Color.LightGray, sections: List<DonutSection>)
Maximum value of sum of all entries in view, after which all lines start to resize proportionally to amounts in their entry categories.

Functions

component1
Link copied to clipboard
operator fun component1(): Float
component2
Link copied to clipboard
operator fun component2(): Float
component3
Link copied to clipboard
operator fun component3(): Float
component4
Link copied to clipboard
operator fun component4(): Float
component5
Link copied to clipboard
operator fun component5(): Float
component6
Link copied to clipboard
operator fun component6(): Color
component7
Link copied to clipboard
operator fun component7(): List<DonutSection>
copy
Link copied to clipboard
fun copy(cap: Float, masterProgress: Float = 1f, gapWidthDegrees: Float = 90f, gapAngleDegrees: Float = 90f, strokeWidth: Float = 30f, backgroundLineColor: Color = Color.LightGray, sections: List<DonutSection>): DonutModel
equals
Link copied to clipboard
open operator override fun equals(other: Any?): Boolean
hashCode
Link copied to clipboard
open override fun hashCode(): Int
toString
Link copied to clipboard
open override fun toString(): String

Properties

backgroundLineColor
Link copied to clipboard
var backgroundLineColor: Color
The color of the donut background line.
cap
Link copied to clipboard
var cap: Float
Maximum value of sum of all entries in view, after which all lines start to resize proportionally to amounts in their entry categories.
gapAngleDegrees
Link copied to clipboard
var gapAngleDegrees: Float = 90f
The angle in degrees, at which the gap will be displayed.
gapWidthDegrees
Link copied to clipboard
var gapWidthDegrees: Float = 90f
Size of gap opening in degrees.
masterProgress
Link copied to clipboard
var masterProgress: Float = 1f
Percentage of progress shown for all lines.
sections
Link copied to clipboard
var sections: List<DonutSection>
The data used to define each section of the donut.
sectionsCap
Link copied to clipboard
val sectionsCap: Float
strokeWidth
Link copied to clipboard
var strokeWidth: Float = 30f
Stroke width of all lines in pixels.