ASE Home Page Products Download Purchase Support About ASE
ChartDirector Support
Forum HomeForum Home   SearchSearch

Message ListMessage List     Post MessagePost Message

  format number
Posted by ricardo on Jun-23-2012 08:59
how to format the number in a circle graph lines and I mean the values ​​in the legends

for example the value is 103548.23 and I want to leave 103,548.23

  Re: format number
Posted by Peter Kwan on Jun-25-2012 20:25
HI ricardo,

You may format a number by using a suitable format string. For example "{value|,}".

The exact API to call to apply the format string depends on your chart type and which labels you would like to format. I am not too sure what you mean by "circle graph lines" or "values in the legends". Would you mind to clarify or attach an example to help me understand what is "circle graph lines" and "values in the legends"?

As an example, suppose you would like to change the sector label in a pie chart (like in the "Exploded Pie Chart" sample code). In the original sample code, the format string is (in C#/Java):

c.setLabelFormat("<*block,halign=center,width=110*>{label}<*br*><*font=arial.ttf,size=8*>US$ {value}M ({percent}%)<*/*>");

You can change the {value} above to {value|,}.

Another method is to use BaseChart.setNumberFormat to change the default thousand separator. For example:

c.setNumberFormat(',', '.', '-');

Regards
Peter Kwan