Gauge Scale Label Format In Thousands

2 posts, 0 answers
  1. Muthukumar
    Muthukumar avatar
    15 posts
    Member since:
    Oct 2011

    Posted 03 Oct 2011 Link to this post

    hi team,
    i am having a Radgauge with  RadialScale  min ="1000", max ="10000" and step=1000. Jus i need this scale label format like 
    1k,2k,3k,......10k ( Thousand "K" format). Is there any properties needs to set to get this format. please help me out it . if there is a way just send me the sample code. Thanks in advance.

    this is my code,
    <telerik:RadialGauge<br> 
                       <
    span class="Apple-tab-span" style="white-space:pre">   
                   </
    span>Style="{StaticResource RadialGaugeHalfCircleNStyle}"<br>   
                     <
    span class="Apple-tab-span" style="white-space:pre">        

              </
    span>Background="{x:Null}"<br>           
             <
    span class="Apple-tab-span" style="white-space:pre">        
             </
    span>BorderBrush="{x:Null}"<br>                   
     <
    span class="Apple-tab-span" style="white-space:pre">           
             </
    span>OuterBackground="{x:Null}"<br>             
           <
    span class="Apple-tab-span" style="white-space:pre">      
                  </
    span>OuterBorderBrush="#FF1E212A"<br>     
                  <
    span class="Apple-tab-span" style="white-space:pre">   
                   </
    span>x:Name="RadialGauge1VR"><br><br><br>   
                    <
    span class="Apple-tab-span" style="white-space:pre"
                      </
    span><telerik:RadialScale<br>
                        <
    span class="Apple-tab-span" style="white-space:pre"
                          </
    span>Style="{StaticResource RadialScaleHalfCircleNStyle}"<br
                      <
    span class="Apple-tab-span" style="white-space:pre">
                          </
    span>Min="1000" Max="10000"<br>                   
     <
    span class="Apple-tab-span" style="white-space:pre">                        </span>MajorTickStep="1000"<br>                    <span class="Apple-tab-span" style="white-space:pre">                      </span>LabelRotationMode="None"<br>                    <span class="Apple-tab-span" style="white-space:pre">                      </span>FontWeight="SemiBold"<br>                    <span class="Apple-tab-span" style="white-space:pre">                     </span>x:Name="RadialScale1">                                            <br>                    <span class="Apple-tab-span" style="white-space:pre">                       </span><telerik:RadialScale.Label><br>                                                <br>                    <span class="Apple-tab-span" style="white-space:pre">                            </span><telerik:LabelProperties<br>                    <span class="Apple-tab-span" style="white-space:pre">                               </span>Location="CenterOutside" /><br>                    <span class="Apple-tab-span" style="white-space:pre">                        </span></telerik:RadialScale.Label><br>                    <span class="Apple-tab-span" style="white-space:pre">                        </span><br>                    <span class="Apple-tab-span" style="white-space:pre">                      </span><telerik:IndicatorList><br>                    <span class="Apple-tab-span" style="white-space:pre">                         </span><telerik:Needle<br>                    <span class="Apple-tab-span" style="white-space:pre">                                </span>x:Name="gauge1_needle1"<br>                    <span class="Apple-tab-span" style="white-space:pre">                               </span>Value="{Binding Voidage.FirstNeedleValue}"<br>                    <span class="Apple-tab-span" style="white-space:pre">                                </span>ArrowBackground="Black"<br>                    <span class="Apple-tab-span" style="white-space:pre">                               </span>ArrowBorderBrush="Black"<br>                    <span class="Apple-tab-span" style="white-space:pre">                              </span>IsAnimated="True"<br>                    <span class="Apple-tab-span" style="white-space:pre">                             </span>Height="13"<br>                    <span class="Apple-tab-span" style="white-space:pre">                               </span>Background="{x:Null}"<br>                    <span class="Apple-tab-span" style="white-space:pre">                             </span>BorderBrush="{x:Null}"<br>                    <span class="Apple-tab-span" style="white-space:pre">                                </span>HorizontalAlignment="Stretch"><br>                    <span class="Apple-tab-span" style="white-space:pre">                             </span><telerik:Needle.Effect><br>                    <span class="Apple-tab-span" style="white-space:pre">                                 </span><DropShadowEffect<br>                    <span class="Apple-tab-span" style="white-space:pre">                                      </span>BlurRadius="4"<br>                    <span class="Apple-tab-span" style="white-space:pre">                                        </span>ShadowDepth="2"<br>                    <span class="Apple-tab-span" style="white-space:pre">                                       </span>Opacity="0.75" /><br>                    <span class="Apple-tab-span" style="white-space:pre">                              </span></telerik:Needle.Effect><br><br><br>                    <span class="Apple-tab-span" style="white-space:pre">                            </span></telerik:Needle><br><br><br>                    <span class="Apple-tab-span" style="white-space:pre">                       </span></telerik:IndicatorList><br>                    <span class="Apple-tab-span" style="white-space:pre">                    </span></telerik:RadialScale><br>                    <span class="Apple-tab-span" style="white-space:pre">              </span></telerik:RadialGauge>


    thanks,
    Muthukumar Nagarajan.





  2. Andrey
    Admin
    Andrey avatar
    1681 posts

    Posted 06 Oct 2011 Link to this post

    Hello Muthukumar,

    Unfortunately your code is unreadable. It looks like you've copied it from MS Word or other text editior.

    To set format of the gauge label you should use Format property of the LabelProperties object. For example:

    <telerik:RadGauge x:Name="radGauge">
        <telerik:RadialGauge>
            <telerik:RadialScale x:Name="linearScale"
                 Min="1000"
                 Max="10000"
                 MajorTickStep="1000">
                <telerik:RadialScale.Label>
                    <telerik:LabelProperties Foreground="Red" Format="{}{0:0,}K"  />
                </telerik:RadialScale.Label>
                <telerik:IndicatorList>
                    <telerik:Needle />
                </telerik:IndicatorList>
            </telerik:RadialScale>
        </telerik:RadialGauge>
    </telerik:RadGauge>

    Format property accepts .NET format strings. You can find more details here:

    http://msdn.microsoft.com/en-us/library/dwhawy9k.aspx
    http://msdn.microsoft.com/en-us/library/0c899ak8.aspx

    Regards,
    Andrey Murzov
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

  3. DevCraft banner
Back to Top