This is a migrated thread and some comments may be shown as answers.
Value rounding
4 Answers 36 Views
This is a migrated thread and some comments may be shown as answers.
ScimarGreg
Top achievements
Rank 2
ScimarGreg asked on 23 Mar 2011, 12:42 AM

Default Double values are rounded to two decimal places. I'm afraid I couldn't find any information in documentation or examples that explained how this can be changed? We're building a statistics app and need up to 6 decimal places for MIN, MAX, STDEV values, etc. in our dataset.

Could anybody point me in a good direction or have an example how to adjust rounding of values? Example code below:

protected void ProxyLoadStatisticsCompleted(object sender, LoadStatisticsCompletedEventArgs e)
       {
           if (e.Error == null && e.Result != null)
           {
               var series = new DataSeries();
               series.Definition = new LineSeriesDefinition();
               series.Definition.ShowItemLabels = true;
               series.Definition.ShowItemToolTips = true;
               series.Definition.EmptyPointBehavior = EmptyPointBehavior.Drop;
               series.Definition.Appearance.PointMark.Fill = new SolidColorBrush(Colors.Orange);
               series.Definition.Appearance.Fill = new SolidColorBrush(Colors.Orange);
               series.Definition.InteractivitySettings.HoverScope = InteractivityScope.Series;
               (series.Definition as LineSeriesDefinition).ShowPointMarks = true;
               series.LegendLabel = "Min Value";
               timeChart.DefaultView.ChartArea.DataSeries.Add(series);
           }
       }

4 Answers, 1 is accepted

Sort by
0
Missing User
answered on 25 Mar 2011, 02:01 PM
Hello Greg,

RadChart supports format expressions, which you can use to format the series items labels, axes labels and tooltip texts. The standard and the custom numeric format expressions are also supported. More information about Format Expressions can be found in this help topic.
For example you can use the following format:
Series.Definition.ItemLabelFormat = "#Y{0.######}";

Kind regards,
Polina
the Telerik team
0
Leland
Top achievements
Rank 1
answered on 26 Oct 2012, 02:05 PM
How can this be done in XAML?
0
Petar Marchev
Telerik team
answered on 31 Oct 2012, 07:43 AM
Hi Leland,

You can try this:
<telerik:BarSeriesDefinition ItemLabelFormat="#Y{N6}" />

Regards,
Petar Marchev
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

0
Leland
Top achievements
Rank 1
answered on 20 Nov 2012, 09:34 PM
Worked for me...thanks.
Tags
Chart
Asked by
ScimarGreg
Top achievements
Rank 2
Answers by
Missing User
Leland
Top achievements
Rank 1
Petar Marchev
Telerik team
Share this question
or