LineSpec

constructor(lineColor: Int = Color.LTGRAY, lineThicknessDp: Float = DefaultDimens.LINE_THICKNESS, lineBackgroundShader: DynamicShader? = null, lineCap: Paint.Cap = Paint.Cap.ROUND, point: Component? = null, pointSizeDp: Float = DefaultDimens.POINT_SIZE, dataLabel: TextComponent? = null, dataLabelVerticalPosition: VerticalPosition = VerticalPosition.Top, dataLabelValueFormatter: ValueFormatter = DecimalFormatValueFormatter(), dataLabelRotationDegrees: Float = 0.0f, pointConnector: LineChart.LineSpec.PointConnector = DefaultPointConnector())

Parameters

lineColor

the color of the line.

lineThicknessDp

the thickness of the line (in dp).

lineBackgroundShader

an optional DynamicShader to use for the area below the line.

lineCap

the stroke cap for the line.

point

an optional Component that can be drawn at a given point on the line.

pointSizeDp

the size of the point (in dp).

dataLabel

an optional TextComponent to use for data labels.

dataLabelVerticalPosition

the vertical position of data labels relative to the line.

dataLabelValueFormatter

the ValueFormatter to use for data labels.

dataLabelRotationDegrees

the rotation of data labels (in degrees).

pointConnector

the PointConnector for the line.


constructor(lineColor: Int = Color.LTGRAY, lineThicknessDp: Float = DefaultDimens.LINE_THICKNESS, lineBackgroundShader: DynamicShader? = null, lineCap: Paint.Cap = Paint.Cap.ROUND, cubicStrength: Float, point: Component? = null, pointSizeDp: Float = DefaultDimens.POINT_SIZE, dataLabel: TextComponent? = null, dataLabelVerticalPosition: VerticalPosition = VerticalPosition.Top, dataLabelValueFormatter: ValueFormatter = DecimalFormatValueFormatter(), dataLabelRotationDegrees: Float = 0.0f)

Deprecated (with error)

Rather than using this constructor and its `cubicStrength` parameter, use the primary constructor and provide a `DefaultPointConnector` instance with a custom `cubicStrength` via the `pointConnector` parameter.

Replace with

import com.patrykandpatrick.vico.core.chart.DefaultPointConnector
LineSpec(
                        lineColor = lineColor,
                        lineThicknessDp = lineThicknessDp,
                        lineBackgroundShader = lineBackgroundShader,
                        lineCap = lineCap,
                        point = point,
                        pointSizeDp = pointSizeDp,
                        dataLabel = dataLabel,
                        dataLabelVerticalPosition = dataLabelVerticalPosition,
                        dataLabelValueFormatter = dataLabelValueFormatter,
                        dataLabelRotationDegrees = dataLabelRotationDegrees,
                        pointConnector = DefaultPointConnector(cubicStrength = cubicStrength),
                    )

Defines the appearance of a line in a line chart.

Parameters

lineColor

the color of the line.

lineThicknessDp

the thickness of the line (in dp).

lineBackgroundShader

an optional DynamicShader to use for the area below the line.

lineCap

the stroke cap for the line.

cubicStrength

the strength of the cubic bezier curve between each point on the line.

point

an optional Component that can be drawn at a given point on the line.

pointSizeDp

the size of the point (in dp).

dataLabel

an optional TextComponent to use for data labels.

dataLabelVerticalPosition

the vertical position of data labels relative to the line.

dataLabelValueFormatter

the ValueFormatter to use for data labels.

dataLabelRotationDegrees

the rotation of data labels in degrees.