ColumnChart

open class ColumnChart(var columns: List<LineComponent>, var spacingDp: Float = DefaultDimens.COLUMN_OUTSIDE_SPACING, var innerSpacingDp: Float = DefaultDimens.COLUMN_INSIDE_SPACING, var mergeMode: ColumnChart.MergeMode = MergeMode.Grouped, var targetVerticalAxisPosition: AxisPosition.Vertical? = null, var dataLabel: TextComponent? = null, var dataLabelVerticalPosition: VerticalPosition = VerticalPosition.Top, var dataLabelValueFormatter: ValueFormatter = DecimalFormatValueFormatter(), var dataLabelRotationDegrees: Float = 0.0f, var drawingModelInterpolator: DrawingModelInterpolator<ColumnChartDrawingModel.ColumnInfo, ColumnChartDrawingModel> = DefaultDrawingModelInterpolator()) : BaseChart<ChartEntryModel>

ColumnChart displays data as vertical bars. It can group and stack columns.

Parameters

columns

the LineComponent instances to use for columns. This list is iterated through as many times as necessary for each column collection. If the list contains a single element, all columns have the same appearance.

spacingDp

the distance between neighboring column collections.

innerSpacingDp

the distance between neighboring grouped columns.

mergeMode

defines how columns should be drawn in column collections.

targetVerticalAxisPosition

if this is set, any AxisRenderer with an AxisPosition equal to the provided value will use the ChartValues provided by this chart. This is meant to be used with ComposedChart.

dataLabel

an optional TextComponent to use for data labels.

dataLabelVerticalPosition

the vertical position of data labels relative to the top of their respective columns.

dataLabelValueFormatter

the ValueFormatter to use for data labels.

dataLabelRotationDegrees

the rotation of data labels (in degrees).

drawingModelInterpolator

interpolates the ColumnChart’s ColumnChartDrawingModels.

Constructors

Link copied to clipboard
constructor(column: LineComponent, spacingDp: Float = DefaultDimens.COLUMN_OUTSIDE_SPACING, targetVerticalAxisPosition: AxisPosition.Vertical? = null)

Creates a ColumnChart with a common style for all columns.

constructor()

Creates a ColumnChart instance with columns set to an empty list. The list must be populated before the chart is drawn.

constructor(columns: List<LineComponent>, spacingDp: Float = DefaultDimens.COLUMN_OUTSIDE_SPACING, innerSpacingDp: Float = DefaultDimens.COLUMN_INSIDE_SPACING, mergeMode: ColumnChart.MergeMode = MergeMode.Grouped, targetVerticalAxisPosition: AxisPosition.Vertical? = null, dataLabel: TextComponent? = null, dataLabelVerticalPosition: VerticalPosition = VerticalPosition.Top, dataLabelValueFormatter: ValueFormatter = DecimalFormatValueFormatter(), dataLabelRotationDegrees: Float = 0.0f, drawingModelInterpolator: DrawingModelInterpolator<ColumnChartDrawingModel.ColumnInfo, ColumnChartDrawingModel> = DefaultDrawingModelInterpolator())

Types

Link copied to clipboard

Defines how a ColumnChart should draw columns in column collections.

Properties

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Links x-axis values to Marker.EntryModels. A Marker.EntryModel holds the data needed to draw a Marker.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Provides the Chart’s ModelTransformer.

Link copied to clipboard

Functions

Link copied to clipboard
open override fun updateChartValues(chartValuesManager: ChartValuesManager, model: ChartEntryModel, xStep: Float?)

Updates the ChartValues stored in the provided ChartValuesManager instance to this Chart’s ChartValues.

Link copied to clipboard
open override fun updateHorizontalDimensions(context: MeasureContext, horizontalDimensions: MutableHorizontalDimensions, model: ChartEntryModel)

Updates the chart’s MutableHorizontalDimensions instance.