Linear Gauge Marker Text?

Gauge for WPF Forum

Posted 14 years ago by Jason Podwojski
Version: 10.1.0522
Avatar
How can I put the value of a linear marker over the marker graphic?

I have tried the following, but as the marker is drawn under the tickset I get tickmarks over the top of the marker.

                                <gauge:LinearTickSet.Pointers>
                                    <gauge:LinearPointerMarker x:Name="markerSpeed" MarkerType="SwordSharp"  ScalePlacement="Inside" PointerAscent="60px" PointerExtent="22px" Background="#EEEEEE" Value="0" ScaleOffset="5px" BorderBrush="White" BorderWidth="1" DampeningMaximumDuration="00:00:00" DampeningMinimumDuration="00:00:00" HasDropShadow="False" Opacity="1" />
                                </gauge:LinearTickSet.Pointers> 
                                
                                <gauge:LinearTickSet.Ticks>
                                    <gauge:LinearTickMarkMinor TickMarkAscent="25px" ScalePlacement="Overlay" ScaleOffset="0px" Background="blue" StartValue="0" EndValue="250" SnapsToDevicePixels="False" TickMarkExtent="2px" />
                                    <gauge:LinearTickMarkMajor TickMarkAscent="50px" TickMarkExtent="2" ScalePlacement="Overlay" ScaleOffset="0px" Background="red" StartValue="0" EndValue="250" MaximumTickVisibility="OnInterval" MinimumTickVisibility="OnInterval" SkipValues="0" />
                                    <gauge:LinearTickLabelMajor FontFamily="Tahoma" FontSize="16" ScalePlacement="Inside" StartValue="0" EndValue="250" ScaleOffset="35px" Foreground="pink" MaximumTickVisibility="OnInterval" MinimumTickVisibility="OnInterval" />
                                    <gauge:LinearTickLabelCustom  FontFamily="Tahoma" FontSize="16" ScalePlacement="Inside" ScaleOffset="35px" Foreground="orange" Text="0" Value="0" Name="labelSpeed" />
                                </gauge:LinearTickSet.Ticks>
I think I need a LinearMarkerLabelCustom to do this? What is the workaround??

Thanks

Jason.

Comments (1)

Posted 14 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Hi Jason,

You can use the ZIndex property to explicitly order the elements. Otherwise, they will be ordered as they are in the XAML (or added to the LinearTickSet). So, in your case, you can move the Pointers below the Ticks, then set a ZIndex of 1 for your custom label. That way, the custom label will appear on top of the marker, but the remaining ticks will be below.

Unfortunately, your custom label won't "follow" the marker, atleast not with animations enabled. I've marked down a TODO item for adding a "Text" pointer so you could have the text follow the marker, even with animations/dampening.


Actipro Software Support

The latest build of this product (v24.1.2) was released 4 days ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.