Skip to content
This repository has been archived by the owner on Jan 9, 2023. It is now read-only.

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

Open
Stephen-Ross opened this issue Aug 3, 2022 · 0 comments

Comments

@Stephen-Ross
Copy link

Stephen-Ross commented Aug 3, 2022

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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant