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

Pointer padding / custom label formatter #280

Open
mstainer14 opened this issue Jul 15, 2024 · 0 comments
Open

Pointer padding / custom label formatter #280

mstainer14 opened this issue Jul 15, 2024 · 0 comments

Comments

@mstainer14
Copy link

mstainer14 commented Jul 15, 2024

Is your feature request related to a problem? Please describe.
I cannot find a way to add padding to the linear gauge, as you can see in the below image there is padding/margin between the pointer and the gauge itself.

Additionally, as per the below image, I would like a custom label formatter where we can specify the text to show for the label. E.g. instead of showing the double value of the gauge, we can show any text.

Screenshot from 2024-07-15 10-12-43

Describe the solution you'd like
A good solution would be to add a padding property to the Pointer object, this padding value can be used when calculating the offset of the label before drawing onto the canvas.

A potential solution for the custom label could be to have a property similar to the onchanged property that gives the user access to the double value but returns a string object and the user has a choice if they want to use the double value or not.
I.e.,

Pointer(
  labelFormatter: (value) {
    if (condition) {
      return value.toString();
    } else {
      return "F1";
    }
  },
)

Additional context
Add any other context or screenshots about the feature request here.

Example of final product:
Screenshot from 2024-07-15 10-12-43

Many thanks guys, a really great Gauge library!

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