Line Chart

A line chart is a data visualization that uses data points connected by lines to show trends or changes over time. It’s ideal for displaying continuous data, such as stock prices, temperature, or sales growth.

TypeResource
DesignFigma
MobileMobile Storybook
CodeGitlab

Line Chart Preview

Usage

  import id.co.biofarma.binduiandroid.components.linechart.*
    val dataSet1 = listOf(
          DataSetLineChart(
              label = "Data Line 1",
              data = listOf(1.0, 2.0, 3.0, 4.0, 5.0, 6.0)
          )
      )
 
      LineChart(
          id = "bio-line-chart",
          dataSet = dataSet1,
          modifier = Modifier.fillMaxSize(),
          lineType = "line",
          xAxisData = listOf("Jan", "Feb", "Mar", "Apr", "May", "Jun"),
          legendPosition = "top",
          lineShadow = true,
          yAxisRange = 10
      )

Examples

lineType

Set the lineType to line or curved to determine line style of chart

Line Chart lineType

legendOrientation

Set the legendOrientation to top, bottom, or none determine position of the legend.

Line Chart legendOrientation


lineShadow

Set the lineShadow to true or false to determine position of the legend.

Line Chart lineShadow


Props

PropsRequiredDefaultTypedescription
idfalsebiofarma-line-chartStringA unique identifier for the Line Chart.
dataSetfalselistOf()List<DataSetLineChart>Set data to be rendered in the chart.
xAxisDatafalseemptyList()List<String>Set x-axis data of the chart.
yAxisRangefalse10IntSet y-axis range of the chart.
lineTypefalselineline, curvedSet line type of the chart.
lineShadowfalsetrueBooleanSet line shadow the chart..
legendOrientationfalsetoptop, bottom, noneLegend position of the cart.
modifiertrue-ModifierModifier for additional styling and layout modifications.
BIND © Biofarma Innovate Next-level Design .