Is it possible to draw a line annotation? #1586
Replies: 2 comments 5 replies
-
Hi, I'll try to explain:
No, take a look in the docs: https://livecharts.dev/api/2.0.0-rc2/LiveChartsCore.VisualElements.VisualElement-1, especially in the "derived" section: There you can find a lot of classes in the libraries that inherit from VisualElement, some of them are really simple, like the GeometryVisual (it draws basic shapes, like circles and rectangles) and some of them are more complex like the AngularTicks that draws all the thick marks in the angular gauge class. You can use both examples as a base to build your own. Alternatively, there is a way to use all the power of SkiaSharp to draw anything in the chart: https://livecharts.dev/docs/WPF/2.0.0-rc2/samples.general.drawOnCanvas I close this issue and move it to a discussion since it seems there an answer for your query, feel free to reply if you need further assitance. |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Is your feature request related to a problem? Please describe.
As far as I can tell a visual element needs to be of type ISizedGeometry which LineGeometry is not, and sections can only be rectangular. Neither of these options are ideal when using a strokes with a dash style as the dash returns on itself (i.e. 0 width rectangles).
I'm wondering if it is possible to draw a line as a visual element or some other element except a Series.
Describe the solution you'd like
Allow for 1D visual elements which are not of type ISized geometry.
Describe alternatives you've considered
As discussed above tried using VisualGeometry and RectangleSection to emulate a line but neither case was ideal.
Additional context
Add any other context or screenshots about the feature request here.
Beta Was this translation helpful? Give feedback.
All reactions