This is a migrated thread and some comments may be shown as answers.

SemiCircle Gauge Max Value Label Suffix

6 Answers 65 Views
Gauge
This is a migrated thread and some comments may be shown as answers.
Luis Rizo
Top achievements
Rank 1
Luis Rizo asked on 17 Dec 2009, 06:53 PM
I'm having an issue when setting max values at or above 10,000 for my semi-circle radial gauge. The number 10000 is too long and bleeds throw the bottom of the gauge (see attached screenshot), is there some way I can change the label style so it would suffix "K" and show 10K instead of 10,000, and likewise M for numbers in the millions (1M, 10M, as opposed to 1000K, 10000K or 1000000 etc.)?

I know that there's a "Multiplier" property, but I feel that in the context of my application, the letter suffix would be more intuitive and easier to understand from the user's standpoint.

Thanks in advance.

6 Answers, 1 is accepted

Sort by
0
Andrey
Telerik team
answered on 21 Dec 2009, 08:51 AM
Hello Luis Rizo,

Thank you for the feedback.
In addition to Multiplier you can use the Format property of the LabelProperties element to show a suffix near the labels. The following sample code shows "K" suffix for the labels:

<gauge:RadialScale>
...
    <gauge:RadialScale.Label>
        <gauge:LabelProperties Format="{}{0:F0}K"/>
    </gauge:RadialScale.Label>
...
</gauge:RadialScale>


Kind regards,
Andrey Murzov
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Edward
Top achievements
Rank 1
answered on 16 Oct 2010, 11:00 AM
Hi Andrey,
 
I'm using a variety of gauges that must be created programmatically and accept values that can vary from 1 upto 10 Billion.
 
I'm trying to use both the Multiplier property (to decrease the size of the numbers displayed on the scale) and the Format string to display K, M or B after the numbers on the scale appropriately. I'm finding this very difficult because no documentation seems to exist for either Multiplier of Format.
 
Is it possible you could post a simple example of the use of these settings using code-behind?
 
Many Thanks,
 
Edward Smith.
0
Andrey
Telerik team
answered on 20 Oct 2010, 03:53 PM
Hi Edward,

The code below demonstrates how to add the gauge from a code using Multiplier and Format properties.
The sample uses a scale from 0 to 10 millions.
<UserControl x:Class="GaugeMultiplier.MainPage"
    mc:Ignorable="d"
    d:DesignHeight="300" d:DesignWidth="400">
    <Grid x:Name="LayoutRoot" Background="White">
    </Grid>
</UserControl>
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Threading;
using Telerik.Windows.Controls;
using Telerik.Windows.Controls.Gauges;
  
namespace GaugeMultiplier
{
    public partial class MainPage : UserControl
    {
        public MainPage()
        {
            InitializeComponent();
  
            Loaded += new RoutedEventHandler(MainPage_Loaded);
        }
  
        private void MainPage_Loaded(object sender, RoutedEventArgs e)
        {
            RadGauge radGauge = new RadGauge();
  
            RadialGauge radialGauge = new RadialGauge();
            radGauge.Content = radialGauge;
  
            RadialScale scale = new RadialScale()
            {
                Min = 0,
                Max = 10000000,
                Multiplier = 1d / 1000000d
            };
            scale.Label.Format = "{0:F0}M";
            radialGauge.Items.Add(scale);
  
            Needle needle = new Needle()
            {
                Name = "needle",
                IsAnimated = true,
                Value = 7000000
            };
            scale.Indicators.Add(needle);
  
            LayoutRoot.Children.Add(radGauge);
        }
    }
}

Best wishes,
Andrey Murzov
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Edward
Top achievements
Rank 1
answered on 20 Oct 2010, 05:20 PM
Thanks Andrey,
The settings shown in your code work perfectly for me. Many thanks for your prompt and careful assistance.
Edward.
0
Edward
Top achievements
Rank 1
answered on 13 Jun 2016, 03:29 PM

Hi, 

When I was looking into something I got my old post. It seems that all the Gauge labels are using "en-US" culture. 

If a spain user wants to view the component, my component labels are wrong.

I meant, the value 2500 in en-US culture is 2.5K. But for es-ES culture 2.5K is not 2500. 2,5K is 2500.

How do I force telerik component to use es-ES culture before drawing the gauge?

I would like to do it code-behind.  How can I achieve this?

0
Petar Marchev
Telerik team
answered on 16 Jun 2016, 08:12 AM
Hello Edward,

It appears that you are using the old RadGauge which was obosleted with 2014 Q1. We do not support this control anymore. We now have the gauge controls in the DataVisualization assembly. If you have questions about the new control, you can open a new support ticket.

Regards,
Petar Marchev
Telerik
Do you need help with upgrading your AJAX, WPF or WinForms project? Check the Telerik API Analyzer and share your thoughts.
Tags
Gauge
Asked by
Luis Rizo
Top achievements
Rank 1
Answers by
Andrey
Telerik team
Edward
Top achievements
Rank 1
Edward
Top achievements
Rank 1
Petar Marchev
Telerik team
Share this question
or