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

Format Decimals in the Horizontal Axis

2 Answers 164 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Sergio
Top achievements
Rank 1
Sergio asked on 13 Jun 2020, 02:02 PM

Hi. I need your help about formatting my KendoUI chart.I use KendoUI chart with my Delphi + Unigui code

My doubts are in  the figure attached. The main doubt is how to format the horizontal axis to show the desired number of decimals. I want to change from one decimal ( one number after the comma like   2200,0  ) to two decimals   (like 2200,00 ). This line of code did not work TNumericField(FieldByName('distM')).DisplayFormat :=  '#,0.00';
Code to try to fix the decimals
ChartSeries.Values['Fmod'] := 'serFmod';
ChartProperties.Values['valueAxis'] := '{labels: {format: "#,0.0"}}';             // vertical  axis  one decimal
ChartProperties.Values['tooltip'] := '{visible: true, format: "#,0.000"}';          // points   3 decimals
ChartSeriesDefaults := 'labels: {visible: true, position: "insideEnd", format: "#,0.00"}';

If needed I can send a test case using Delphi + Unigui.

2 Answers, 1 is accepted

Sort by
0
Silviya Stoyanova
Telerik team
answered on 16 Jun 2020, 05:40 PM

Hello Sergio,

In order to format the number with the desired number of decimal places I would suggest using the format as follows:

labels: {
   format: "{0:n2}"  // with two decimal places
},
You will find a sample here: https://dojo.telerik.com/@Silvia/eSEnuYuK

 

For more information on other number formats available, you can check this article:

https://docs.telerik.com/kendo-ui/globalization/intl/numberformatting

Kind Regards,
Silviya Stoyanova
Progress Telerik

Progress is here for your business, like always. Read more about the measures we are taking to ensure business continuity and help fight the COVID-19 pandemic.
Our thoughts here at Progress are with those affected by the outbreak.
0
Sergio
Top achievements
Rank 1
answered on 16 Jun 2020, 08:52 PM

Thank you Silviya for the useful answer

Kind Regards

Sergio Feitoza


Tags
General Discussions
Asked by
Sergio
Top achievements
Rank 1
Answers by
Silviya Stoyanova
Telerik team
Sergio
Top achievements
Rank 1
Share this question
or