Skip to content

The first label of the Y-axis is not shown when the label position is set to Inside #1090

Open
@EricerYang

Description

@EricerYang

Example

The first label of the Y-axis is not shown when VerticalLabelPosition.Top and HorizontalLabelPosition.Inside.

How to reproduce

I directly added the code from the asterisked section into the link below.
https://github.com/patrykandpatrick/vico/blob/master/sample/compose/src/main/kotlin/com/patrykandpatrick/vico/sample/compose/BasicLineChart.kt#L44

@Composable
private fun JetpackComposeBasicLineChart(
  modelProducer: CartesianChartModelProducer,
  modifier: Modifier = Modifier,
) {
  CartesianChartHost(
    chart =
      rememberCartesianChart(
        rememberLineCartesianLayer(),
        startAxis = VerticalAxis.rememberStart(
          horizontalLabelPosition = VerticalAxis.HorizontalLabelPosition.Inside, ★★★
          verticalLabelPosition = Position.Vertical.Top, ★★★
        ),
        bottomAxis = HorizontalAxis.rememberBottom(),
      ),
    modelProducer = modelProducer,
    modifier = modifier,
  )
}

Observed behavior

The first label of the Y-axis is not shown when the label position is set to Inside.

Outside Inside
Image Image

Expected behavior

The first label of the Y-axis is shown when the label position is set to Inside.
Image

Module(s)

compose-m3

Platform(s)

Android

Platform version(s)

8

Vico version(s)

2.1.2

Additional information

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions