Round the decimal value problem

TeeChart for JavaScript for the HTML5 Canvas
Post Reply
SenSeo
Newbie
Newbie
Posts: 71
Joined: Wed Mar 09, 2016 12:00 am

Round the decimal value problem

Post by SenSeo » Wed May 04, 2016 11:32 am

If we pass the decimal value to the series, the same value should be displayed in the legend and the segment of pie chart. Instead it displays like 5.30,3.50,2.50,7.50,1.70 .

It seems the value "0" is appended to each value of series array.

function draw() {
Chart1=new Tee.Chart("canvas");
Chart1.addSeries(new Tee.Pie([5.3,3.5,2.5,7.5,1.7],['Sun','Mon','Tue','Wed','Thu']) );
Chart1.draw();
}

Is there any way to fix this for decimal values?

Yeray
Site Admin
Site Admin
Posts: 9613
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: Round the decimal value problem

Post by Yeray » Wed May 04, 2016 3:39 pm

Hello,

Yes, you can change the decimals property for that series:

Code: Select all

Chart1.series.items[0].decimals = 1;
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

SenSeo
Newbie
Newbie
Posts: 71
Joined: Wed Mar 09, 2016 12:00 am

Re: Round the decimal value problem

Post by SenSeo » Thu May 05, 2016 3:16 am

Thanks. It is working now as expected.

Post Reply