ThresholdLine

data class ThresholdLine(val thresholdRange: ClosedFloatingPointRange<Float>, val thresholdLabel: CharSequence = RANGE_FORMAT.format( decimalFormat.format(thresholdRange.start), decimalFormat.format(thresholdRange.endInclusive), ), val lineComponent: ShapeComponent = ShapeComponent(), val minimumLineThicknessDp: Float = DefaultDimens.THRESHOLD_LINE_THICKNESS, val labelComponent: TextComponent = textComponent(), val labelHorizontalPosition: ThresholdLine.LabelHorizontalPosition = LabelHorizontalPosition.Start, val labelVerticalPosition: ThresholdLine.LabelVerticalPosition = LabelVerticalPosition.Top, val labelRotationDegrees: Float = 0.0f) : Decoration

ThresholdLine is drawn on top of charts and marks a certain range of y-axis values.

See also

Constructors

Link copied to clipboard
constructor(thresholdValue: Float, thresholdLabel: CharSequence = decimalFormat.format(thresholdValue), lineComponent: ShapeComponent = ShapeComponent(), minimumLineThicknessDp: Float = DefaultDimens.THRESHOLD_LINE_THICKNESS, labelComponent: TextComponent = textComponent(), labelHorizontalPosition: ThresholdLine.LabelHorizontalPosition = LabelHorizontalPosition.Start, labelVerticalPosition: ThresholdLine.LabelVerticalPosition = LabelVerticalPosition.Top, labelRotationDegrees: Float = 0.0f)

An alternative constructor that accepts a single y-axis value as opposed to a range.

constructor(thresholdRange: ClosedFloatingPointRange<Float>, thresholdLabel: CharSequence = RANGE_FORMAT.format( decimalFormat.format(thresholdRange.start), decimalFormat.format(thresholdRange.endInclusive), ), lineComponent: ShapeComponent = ShapeComponent(), minimumLineThicknessDp: Float = DefaultDimens.THRESHOLD_LINE_THICKNESS, labelComponent: TextComponent = textComponent(), labelHorizontalPosition: ThresholdLine.LabelHorizontalPosition = LabelHorizontalPosition.Start, labelVerticalPosition: ThresholdLine.LabelVerticalPosition = LabelVerticalPosition.Top, labelRotationDegrees: Float = 0.0f)

Types

Link copied to clipboard

Defines the horizontal position of a ThresholdLine’s label.

Link copied to clipboard

Defines the vertical position of a ThresholdLine’s label.

Properties

Link copied to clipboard
Link copied to clipboard

defines the horizontal position of the label.

Link copied to clipboard

the rotation of the label (in degrees).

Link copied to clipboard

defines the vertical position of the label.

Link copied to clipboard

the ShapeComponent drawn as the threshold line.

Link copied to clipboard

the minimal thickness of the threshold line. If the thresholdRange implies a smaller thickness, the minimumLineThicknessDp will be used as the threshold line’s thickness.

Link copied to clipboard
Link copied to clipboard

the range of y-axis values that this ThresholdLine will cover.

Functions

Link copied to clipboard
open override fun onDrawAboveChart(context: ChartDrawContext, bounds: RectF)

Called immediately after the Chart finishes drawing itself.