Skip to content

Customize value labels for lower/upper in range charts #83

@kentcb

Description

@kentcb

Description

Labels for lower/upper values are based on Ticktext except when they don't align perfectly, in which case there does not appear to be a way to customize the labels (they instead show raw values).

Repro steps

let yAxis =
    Axis.LinearAxis.init(
        Title = "Y",
        Showline = true,
        Range = StyleParam.Range.MinMax (0.0, 2.0),
        Tickvals = [0.0 .. 2.0],
        Ticktext = [ "zero"; "one"; "two" ]
    )
Chart.Range(
    [1;2],
    [1;1],
    [0.0;0.53622183],
    [1.0;2.0],
    StyleParam.Mode.None,
    Name = "",
    LowerName = "Lower",
    UpperName = "Upper",
    Labels = [])
|> Chart.withY_Axis (yAxis)
|> Chart.Show

This looks fine when hovering over values that align perfectly with tick increments:

image

But when hovering over misaligned values, one sees the raw value:

image

Expected behavior

A means of providing labels for both upper and lower. In my case, I'm mapping values to times, so when it aligns perfectly I see a time of day, but when it doesn't I see an ugly floating point value.

Actual behavior

As far as I can tell, there's no API for this.

Known workarounds

None.

Related information

  • Windows 10
  • 2.0.0-preview.1
  • .NET 5

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions