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

Custom DataLabel #995

Closed
Enigmatrix opened this issue Apr 30, 2023 · 1 comment
Closed

Custom DataLabel #995

Enigmatrix opened this issue Apr 30, 2023 · 1 comment
Labels
enhancement New feature or request new feature priority 1 might not be fixed in the next release of the library, but it will soon!

Comments

@Enigmatrix
Copy link

Is your feature request related to a problem? Please describe.
I would like a way to create a per-data point DataLabel that isn't just text. I know there are some ways of doing this e.g. custom LabelGeometry for a Series, but there is not way to pass the point itself to them, only a string.

Describe the solution you'd like
The ILabelGeometry<TDrawingContext> having a object DataPoint property. This is likely fine since the default implementor, LabelGeometry, won't use it, but it will allow those wanting to customize their derived LabelGeometry with something more than just a string to base their OnDraw on. They can cast it to the expected type accordingly.

Describe alternatives you've considered
The other option would be having this DataPoint property be of a generic type (so modify ILabelGeometry to ILabelGeometry<TModel, TDrawingContext>). It might not be so bad, especially since for PieSeries<TModel, TVisual, TLabel>, the constraint for TLabel can be where TLabel: ILabelGeometry<TModel, TDrawingContext>, class instead of the current where TLabel: ILabelGeometry<TDrawingContext>, class. Or we can use ChartPoint for DataPoint as well.

Additional context
Trying to create a custom PieChart similar to LiveCharts v1

@beto-rodriguez beto-rodriguez added enhancement New feature or request new feature priority 1 might not be fixed in the next release of the library, but it will soon! labels Jun 8, 2023
beto-rodriguez added a commit that referenced this issue Oct 16, 2024
beto-rodriguez added a commit that referenced this issue Oct 16, 2024
@beto-rodriguez
Copy link
Owner

There is finally an example to fix this:

https://github.com/beto-rodriguez/LiveCharts2/blob/dev/samples/ViewModelsSamples/Pies/Icons/ViewModel.cs

I will close this for now, since this is actually supported in older versions of the library, this sample will be in the website soon.

Thanks for the report.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request new feature priority 1 might not be fixed in the next release of the library, but it will soon!
Projects
None yet
Development

No branches or pull requests

2 participants