Round the decimal value problem

TeeChart for Javascript for the HTML5 Canvas

Round the decimal value problem

Postby 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?
SenSeo
Newbie
Newbie
 
Posts: 71
Joined: Wed Mar 09, 2016 12:00 am

Re: Round the decimal value problem

Postby 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 ImagePlease read our Bug Fixing Policy
Yeray
Site Admin
Site Admin
 
Posts: 8467
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia

Re: Round the decimal value problem

Postby SenSeo » Thu May 05, 2016 3:16 am

Thanks. It is working now as expected.
SenSeo
Newbie
Newbie
 
Posts: 71
Joined: Wed Mar 09, 2016 12:00 am


Return to Javascript / HTML5

Who is online

Users browsing this forum: No registered users and 1 guest

cron