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

Message ListMessage List     Post MessagePost Message

  How to trim labels on y-axis
Posted by Megha on Nov-17-2014 14:53
Hi

I wan to trim labels on y-axis to only two places to decimal point.how to do that.
I tried the following code,but nothing is being trimmed.

c.yAxis().setLabelFormat("{value|E}".trim());

I even tried the substring() as:-
c.yAxis().setLabelFormat("{value|E}".substring(0, 5));
but then the label on Y-axis becomes {valu

  Re: How to trim labels on y-axis
Posted by Peter Kwan on Nov-18-2014 02:27
Hi Megha,

You current code "{value|E}".trim() is trimming the format string, not the labels. To specify
two decimal places, please use "{value|E2}". See:

http://www.advsofteng.com/doc/cdjava.htm#paramsub.htm

Hope this can help.

Regards
Peter Kwan