Custom DataLabel #995
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!
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 aobject 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 forPieSeries<TModel, TVisual, TLabel>
, the constraint forTLabel
can bewhere TLabel: ILabelGeometry<TModel, TDrawingContext>, class
instead of the currentwhere TLabel: ILabelGeometry<TDrawingContext>, class
. Or we can useChartPoint
forDataPoint
as well.Additional context
Trying to create a custom PieChart similar to LiveCharts v1
The text was updated successfully, but these errors were encountered: