'precision' control for Mark.Style to set # of decimal place

Ideas and wishes for TeeChart
Post Reply
ESRI
Newbie
Newbie
Posts: 60
Joined: Wed Mar 09, 2005 5:00 am

'precision' control for Mark.Style to set # of decimal place

Post by ESRI » Fri Apr 13, 2007 4:37 am

Request a 'precision' control for Mark.Style, so user can determine the number of decimal places shown.

In particular, we have users requesting more control over how the percentages are returned on the Marks / Style of a Pie series.

The current options are: Value, Percent, Label, Label and Percent, Label and Value, Legend, Percent Total, Label and Percent Total, X Value, X & Y Values

For the percentages, a control "Decimal places" would be most useful. It would take values of 0, 1, 2, 3... etc. A value of 0 would round to the nearest integer. A value of 1 would give one decimal place precision, value 2 two decimal places, etcetera.

For an example, we have a table that has 8 rows. The Name field lists restaurant names. The Value field lists the 2006 sales of them. The values are:
> 1290900, 434790, 808747, 699880, 543098, 934293, 1098720, 892234
The mathematical percentages for these are :
> 19.0038, 6.4034, 11.9059, 10.3032, 7.9952, 13.7541, 16.1747, 14.4598
When graphed as Pie and the Label and Percent Marks Style, the values are being displayed as:
> 19%, 6.4%, 11.91%, 10.3%, 8%, 13.75%, 16.17%, 14.46%

Our user would initially like to have the option to match what Microsoft Excel does, which is to round the values to integers:
> 20%, 6%, 12%, 10%, 8%, 14%, 16%, 14%

We would also like to have the user be able to set the precision to their liking. So a precision of 1 would result in:
> 19.0%, 6.4%, 11.9%, 10.3%, 8.0%, 13.8%, 16.2%, 14.4%



thanks.
Juan

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Post by Narcís » Fri Apr 13, 2007 7:28 am

Hi Juan,

Have you looked at Series' ValueFormat and PercentFormat properties? For example:

Code: Select all

    TChart1.Series(0).ValueFormat = "#.##0,###"
    TChart1.Series(0).PercentFormat = "##0,## %"
You can either set them at run-time or at design-time using the chart editor at Series->General tab.

Also notice that you can customize marks values using OnGetSeriesMark event.
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

Post Reply