Change CircularTickLabelMajor to display just positive numbers

Gauge for WPF Forum

Posted 3 years ago by lala
Version: 16.1.0630
Avatar

Hi,  I have a CircularGauge with a ticketset contained on it from - to + (Minimum to Maximum). I would like that all the labels from this ticketset were displyed  positive as values . I tried to get this changing the TextFormat for the CircularTickLabelMajor , and also using other approaches in the code behind like

- CircularTickLabelMajor.TextFormat.Replace ("-" , string.Empty);

- CircularTickLabelMajor.toString().Replace ("-" , string.Empty);

Also I tried to trigger the TextInput and PreviewInput event in order to change the values but its never executed.

<gauge:CircularTickSet x:Name="MainRPMScale" MajorInterval="5" MinorInterval="0.5" Minimum="-30" Maximum="30" IntervalOrigin="Minimum" >
<gauge:CircularTickSet.Ticks>
<gauge:CircularTickMarkMajor TickMarkExtent="16" TickMarkAscent="1.5" Background="White"
ScalePlacement="Inside" ScaleOffset="4" />
<gauge:CircularTickMarkMinor TickMarkExtent="8" TickMarkAscent="1" Background="White"
ScalePlacement="Inside" ScaleOffset="4" />

<gauge:CircularTickLabelMajor Foreground="White" FontSize="18" FontFamily="Consolas" x:Name="MainRPMLabelMajor"

ScalePlacement="Inside" ScaleOffset="16" TextFormat="{(0:#;#.00)}"/>
</gauge:CircularTickSet.Ticks>
<gauge:CircularTickSet.Pointers>
</gauge:CircularTickSet>

 I think i am close but not sure what I am doing wrong.

Comments (3)

Posted 3 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Hello,

If I understand you correctly, you are currently seeing tick label numbers from -30 up to zero and then to 30.  But you want it to be 30 down to zero and then to 30.  Is that what you are looking to do?


Actipro Software Support

Posted 3 years ago by lala
Avatar

More or less, I want to keep my ticket set (if possible) from -30 to 30 .This generates a set of labels with positive and negative values (e.g: -30,-20,-10,0,10,20,30) . I want to display labels just with positive values , like ( 30,20,10,0,10,20,30) .

I know I could use two scales/ticketsets (  one from 30 to 0 and another from 0 to 30) and just add the code logic to display my negative values (converted to abs) on the first one ( from 30 to 0).But I would like to keep it simple .I assume with the text format of CircularTickLabelMajor is possible ( or another property or event).

Answer - Posted 3 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Hello,

Ok I think the TextFormat is what you'd want to do but probably like this:

TextFormat="{}{0:##0;##0;0}"


Actipro Software Support

The latest build of this product (v2019.1 build 0682) was released 3 days ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.