How to customize the shape pointer in the .NET MAUI Linear Gauge (SfLinearGauge)?
The Syncfusion® .NET MAUI Linear Gauge (SfLinearGauge) allows you to customize the Shape Pointer. This guide helps you understand how to customize the Shape Pointer using its properties.
The following pre-defined shapes are available for the LinearShapePointer in the SfLinearGauge to designate a particular value. InvertedTriangle is the default shape pointer.
Shape Pointer can be customized using the following properties.
- Size - The ShapeHeight and ShapeWidth properties of LinearShapePointer allow you to customize the size of the shape pointer.
- Color - The Fill property allows you to modify the color of the shape pointer.
- Border - The Stroke and StrokeThickness properties of LinearShapePointer allow for border customization.
- Shadow support - The HasShadow property allows the shadow to be applied.
- Alignment - The Alignment property of LinearShapePointer allows you to modify the alignment of the marker pointer. Start, End, and Center are the three potential marker pointer alignments.
- Position - The Position property of the pointer can be used to modify the position. The shape pointer can be placed Inside, Cross, or Outside the scale. By default, the shape pointer is positioned Outside the scale.
- Offset - It is also possible to adjust the shape pointer’s offset in addition to its Position. The OffsetX and OffsetY properties are the distance from the scale and the cross positioned elements are unaffected by the OffsetX and OffsetY values.
The following code sample demonstrates how to customize the shape pointer with the help of the above properties.
<gauge:SfLinearGauge VerticalOptions="Center" WidthRequest="600">
<gauge:SfLinearGauge.MarkerPointers>
<gauge:LinearShapePointer Value="40"
ShapeType="Triangle"
ShapeHeight="20" ShapeWidth="20"
Fill="DarkBlue"
Stroke="RoyalBlue" StrokeThickness="2"
HasShadow="True"
Alignment="Center"
Position="Inside"
OffsetY="25"/>
</gauge:SfLinearGauge.MarkerPointers>
</gauge:SfLinearGauge>
Output:
Conclusion:
I hope you enjoyed learning how to customize the Shape Pointer in the .NET MAUI Linear Gauge (SfLinearGauge).
Refer to our .NET MAUI Linear Gauge feature tour page to learn about its other groundbreaking feature representations. You can also explore our .NET MAUI Linear Gauge documentation to understand how to present and manipulate data.
For current customers, check out our .NET MAUI components from the License and Downloads page. If you are new to Syncfusion®, try our 30-day free trial to check out our .NET MAUI Linear Gauge and other .NET MAUI components.
Please let us know in the comment section if you have any queries or require clarification. Contact us through our support forums, Direct-Trac, or feedback portal. We are always happy to assist you!