Skip to content
This repository was archived by the owner on Nov 26, 2025. It is now read-only.
This repository was archived by the owner on Nov 26, 2025. It is now read-only.

Negative series points are drawn outside the bounds of the domain axis #790

@Stephen-Ross

Description

@Stephen-Ross

Expected Behaviour
Any series that has a point which would cross the domain axis should stop drawing the line between points at the point where it crosses the axis line.

Actual Behaviour
The line between the positive point and the negative point continues for a bit underneath the domain axis line for a few pixels which is unusual for the user when they are expecting the line to stop on the axis.

You can see this between points 2 and 3 and then from 3 to 4:
image

Steps to Reproduce
Example code

...

@override
Widget build(BuildContext context) {
    return charts.LineChart(
        [
            charts.Series<_Test, num>(
                id: 'Test',
                data: [
                    _Test(0, 1),
                    _Test(1, 3),
                    _Test(2, -1),
                    _Test(3, 5),
                    _Test(4, 2),
                ],
                domainFn: (_Test test, _) => test.x,
                measureFn: (_Test test, _) => test.y,
                measureLowerBoundFn: (_, __) => 0,
                measureOffsetFn: (_, __) => 0,
            ),
        ],
        primaryMeasureAxis: const charts.NumericAxisSpec(
            showAxisLine: true,
            viewport: charts.NumericExtents(0, 10),
        ),
    );
}

...

class _Test {
  final int x;

  final int y;

  _Test(this.x, this.y);
}

I can't see if there is an offset that is being applied to the domain axis line. If someone is able to show a method of stopping this happening it would be appreciated.

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