lineSpec

fun lineSpec(lineColor: Color, lineThickness: Dp = DefaultDimens.LINE_THICKNESS.dp, lineBackgroundShader: DynamicShader? = DynamicShaders.fromBrush( brush = Brush.verticalGradient( listOf( lineColor.copy(alpha = DefaultAlpha.LINE_BACKGROUND_SHADER_START), lineColor.copy(alpha = DefaultAlpha.LINE_BACKGROUND_SHADER_END), ), ), ), lineCap: StrokeCap = StrokeCap.Round, point: Component? = null, pointSize: Dp = DefaultDimens.POINT_SIZE.dp, dataLabel: TextComponent? = null, dataLabelVerticalPosition: VerticalPosition = VerticalPosition.Top, dataLabelValueFormatter: ValueFormatter = DecimalFormatValueFormatter(), dataLabelRotationDegrees: Float = 0.0f, pointConnector: LineChart.LineSpec.PointConnector = DefaultPointConnector()): LineChart.LineSpec

Creates a LineChart.LineSpec for use in LineCharts.

Parameters

lineColor

the color of the line.

lineThickness

the thickness of the line.

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.

pointSize

the size of the point.

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 LineSpec.PointConnector for the line.

See also


fun lineSpec(lineColor: Color, lineThickness: Dp = DefaultDimens.LINE_THICKNESS.dp, lineBackgroundShader: DynamicShader? = DynamicShaders.fromBrush( brush = Brush.verticalGradient( listOf( lineColor.copy(alpha = DefaultAlpha.LINE_BACKGROUND_SHADER_START), lineColor.copy(alpha = DefaultAlpha.LINE_BACKGROUND_SHADER_END), ), ), ), lineCap: StrokeCap = StrokeCap.Round, cubicStrength: Float, point: Component? = null, pointSize: Dp = DefaultDimens.POINT_SIZE.dp, dataLabel: TextComponent? = null, dataLabelVerticalPosition: VerticalPosition = VerticalPosition.Top, dataLabelValueFormatter: ValueFormatter = DecimalFormatValueFormatter(), dataLabelRotationDegrees: Float = 0.0f): LineChart.LineSpec

Deprecated (with error)

Rather than using this `lineSpec` function and its `cubicStrength` parameter, use the `lineSpec` function with the `pointConnector` parameter 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,
                lineThickness = lineThickness,
                lineBackgroundShader = lineBackgroundShader,
                lineCap = lineCap,
                point = point,
                pointSize = pointSize,
                dataLabel = dataLabel,
                dataLabelVerticalPosition = dataLabelVerticalPosition,
                dataLabelValueFormatter = dataLabelValueFormatter,
                dataLabelRotationDegrees = dataLabelRotationDegrees,
                pointConnector = DefaultPointConnector(cubicStrength = cubicStrength),
            )

Creates a LineChart.LineSpec for use in LineCharts.

Parameters

lineColor

the color of the line.

lineThickness

the thickness of the line.

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 key point on the line.

point

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

pointSize

the size of the point.

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.

See also