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

Formatting for tag value in breakdown chart #252

Closed
phil-scott-78 opened this issue Feb 1, 2021 · 4 comments · Fixed by #253
Closed

Formatting for tag value in breakdown chart #252

phil-scott-78 opened this issue Feb 1, 2021 · 4 comments · Fixed by #253
Labels

Comments

@phil-scott-78
Copy link
Contributor

Is your feature request related to a problem? Please describe.
Be nice if the tag's value could have a custom format. My simple example I'd like to just do a {0:N} format on them to get commas, but i could see someone wanting to use something like 4MB, 49 seconds, etc

Describe the solution you'd like

Maybe something like this?

var chart = new BreakdownChart()
    .TagValueFormat(value => $"{value:N}")
    .AddItems(insertReport,
        pair => new BreakdownChartItem(pair.Key, pair.Value, counter++)
    );

Additional context
I could knock this out in a PR pretty easily if needed. Nothing pressing, just thought it'd be neat to have.

@patriksvensson
Copy link
Contributor

@phil-scott-78 Seen the recently pushed PR? Will this solve it for you?

@phil-scott-78
Copy link
Contributor Author

Yup, takes care of my needs. Reason I was suggesting a Func though was a situation where someone might want to display something like file sizes so they'd need more than Format provides. Maybe an overload in the future when that time comes

@patriksvensson
Copy link
Contributor

@phil-scott-78 I've added the lambda support in the latest preview version (should be on NuGet in 10 minutes or so)

@phil-scott-78
Copy link
Contributor Author

looks good!
image

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

Successfully merging a pull request may close this issue.

2 participants