Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Place SideTitleWidget inside of line graph #1844

Open
sdgroot opened this issue Jan 9, 2025 · 0 comments
Open

Place SideTitleWidget inside of line graph #1844

sdgroot opened this issue Jan 9, 2025 · 0 comments

Comments

@sdgroot
Copy link

sdgroot commented Jan 9, 2025

Hi, I would like to place the SideTitleWidget for the left y-axis inside of the graph while also keeping the reservedSize at 0, because I want the graph to take up the entire width of the screen. See screenshot of our UX designer.

Screenshot 2025-01-09 at 22 51 50

Is this possible to do at all? I am able to wrap it in a Transform widget to move to labels to the right, so that they overlap the graph, but as soon as I set the reservedSize to 0, the widgets disappear.

This is what I currently have:

return SideTitleWidget(
      axisSide: meta.axisSide,
      space: 0,
      // fitInside: SideTitleFitInsideData.disable(),
      // fitInside: SideTitleFitInsideData(
      //   enabled: true,
      //   axisPosition: 10,
      //   parentAxisSize: 10,
      //   distanceFromEdge: 10,
      // ),
      child: Transform.translate(
        offset: const Offset(30, 0), // Move the text to the right
        child: Text(
          UnitHelper.unitValueForDisplay(
            value: value,
            valueType: ToolAttributeValueType.pressure,
            unitSystem: unitSystem,
          ),
          style: style,
          textAlign: TextAlign.center,
        ),
      ),
    );

reservedSize = 27
Schermafbeelding 2025-01-09 om 23 04 23

reservedSize = 0
Schermafbeelding 2025-01-09 om 23 02 56

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

No branches or pull requests

1 participant