-
public class LineChart.LineSpecDefines the appearance of a line in a line chart.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public interfaceLineChart.LineSpec.PointConnectorDefines the shape of a line in a line chart by specifying how points are to be connected.
-
Field Summary
Fields Modifier and Type Field Description private final BooleanhasLineBackgroundShaderprivate IntegerlineColorprivate Paint.CaplineStrokeCapprivate FloatlineThicknessDpprivate DynamicShaderlineBackgroundShaderprivate Paint.CaplineCapprivate Componentpointprivate FloatpointSizeDpprivate TextComponentdataLabelprivate VerticalPositiondataLabelVerticalPositionprivate ValueFormatterdataLabelValueFormatterprivate FloatdataLabelRotationDegreesprivate LineChart.LineSpec.PointConnectorpointConnector
-
Constructor Summary
Constructors Constructor Description LineChart.LineSpec(Integer lineColor, Float lineThicknessDp, DynamicShader lineBackgroundShader, Paint.Cap lineCap, Float cubicStrength, Component point, Float pointSizeDp, TextComponent dataLabel, VerticalPosition dataLabelVerticalPosition, ValueFormatter dataLabelValueFormatter, Float dataLabelRotationDegrees)Defines the appearance of a line in a line chart. LineChart.LineSpec(Integer lineColor, Float lineThicknessDp, DynamicShader lineBackgroundShader, Paint.Cap lineCap, Component point, Float pointSizeDp, TextComponent dataLabel, VerticalPosition dataLabelVerticalPosition, ValueFormatter dataLabelValueFormatter, Float dataLabelRotationDegrees, LineChart.LineSpec.PointConnector pointConnector)
-
Method Summary
-
-
Constructor Detail
-
LineChart.LineSpec
LineChart.LineSpec(Integer lineColor, Float lineThicknessDp, DynamicShader lineBackgroundShader, Paint.Cap lineCap, Float cubicStrength, Component point, Float pointSizeDp, TextComponent dataLabel, VerticalPosition dataLabelVerticalPosition, ValueFormatter dataLabelValueFormatter, Float dataLabelRotationDegrees)
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.
-
LineChart.LineSpec
LineChart.LineSpec(Integer lineColor, Float lineThicknessDp, DynamicShader lineBackgroundShader, Paint.Cap lineCap, Component point, Float pointSizeDp, TextComponent dataLabel, VerticalPosition dataLabelVerticalPosition, ValueFormatter dataLabelValueFormatter, Float dataLabelRotationDegrees, LineChart.LineSpec.PointConnector pointConnector)
- 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.
-
-
Method Detail
-
getHasLineBackgroundShader
final Boolean getHasLineBackgroundShader()
-
getLineColor
final Integer getLineColor()
The color of the line.
-
setLineColor
final Unit setLineColor(Integer lineColor)
The color of the line.
-
getLineStrokeCap
final Paint.Cap getLineStrokeCap()
The stroke cap for the line.
-
setLineStrokeCap
final Unit setLineStrokeCap(Paint.Cap lineStrokeCap)
The stroke cap for the line.
-
getLineThicknessDp
final Float getLineThicknessDp()
-
setLineThicknessDp
final Unit setLineThicknessDp(Float lineThicknessDp)
- Parameters:
lineThicknessDp- the thickness of the line (in dp).
-
getLineBackgroundShader
final DynamicShader getLineBackgroundShader()
-
setLineBackgroundShader
final Unit setLineBackgroundShader(DynamicShader lineBackgroundShader)
- Parameters:
lineBackgroundShader- an optional DynamicShader to use for the area below the line.
-
getLineCap
final Paint.Cap getLineCap()
-
setLineCap
final Unit setLineCap(Paint.Cap lineCap)
- Parameters:
lineCap- the stroke cap for the line.
-
setPoint
final Unit setPoint(Component point)
- Parameters:
point- an optional Component that can be drawn at a given point on the line.
-
getPointSizeDp
final Float getPointSizeDp()
-
setPointSizeDp
final Unit setPointSizeDp(Float pointSizeDp)
- Parameters:
pointSizeDp- the size of the point (in dp).
-
getDataLabel
final TextComponent getDataLabel()
-
setDataLabel
final Unit setDataLabel(TextComponent dataLabel)
- Parameters:
dataLabel- an optional TextComponent to use for data labels.
-
getDataLabelVerticalPosition
final VerticalPosition getDataLabelVerticalPosition()
-
setDataLabelVerticalPosition
final Unit setDataLabelVerticalPosition(VerticalPosition dataLabelVerticalPosition)
- Parameters:
dataLabelVerticalPosition- the vertical position of data labels relative to the line.
-
getDataLabelValueFormatter
final ValueFormatter getDataLabelValueFormatter()
-
setDataLabelValueFormatter
final Unit setDataLabelValueFormatter(ValueFormatter dataLabelValueFormatter)
- Parameters:
dataLabelValueFormatter- the ValueFormatter to use for data labels.
-
getDataLabelRotationDegrees
final Float getDataLabelRotationDegrees()
-
setDataLabelRotationDegrees
final Unit setDataLabelRotationDegrees(Float dataLabelRotationDegrees)
- Parameters:
dataLabelRotationDegrees- the rotation of data labels (in degrees).
-
getPointConnector
final LineChart.LineSpec.PointConnector getPointConnector()
-
setPointConnector
final Unit setPointConnector(LineChart.LineSpec.PointConnector pointConnector)
- Parameters:
pointConnector- the PointConnector for the line.
-
drawPoint
final Unit drawPoint(DrawContext context, Float x, Float y)
-
drawLine
final Unit drawLine(DrawContext context, Path path)
Draws the line.
-
drawBackgroundLine
final Unit drawBackgroundLine(DrawContext context, RectF bounds, Path path)
Draws the line background.
-
-
-
-