javafx - Labels representing the different sections of a Piechart are overlapping with one another -


i developing jaxafx application generates reports taking data mysql database. came across issue when working piecharts. whenever fetched data 0, label getting displayed overlaps other labels in piechart making difficult read.

overlapping labels in piechart

relevant bits of code:

fetching data:

get_data_from_pos_basket_for_reporting getreportpaymentpaidunpaidnoclass=new get_data_from_pos_basket_for_reporting();         getreportpaymentpaidunpaidnoclass.getreportpaymentpaidunpaidno(fromdate, untildate);       double amountpaid,amountunpaid;       int totalpaid,totalunpaid;       amountpaid=getreportpaymentpaidunpaidnoclass.getamountpaid();       amountunpaid= getreportpaymentpaidunpaidnoclass.getamountunpaid();       totalpaid=getreportpaymentpaidunpaidnoclass.gettotalpaid();       totalunpaid=getreportpaymentpaidunpaidnoclass.gettotalunpaid();       double totalamountpaidunpaid=amountpaid+paymentsystem+amountunpaid;       double totalnopaidunpaid=totalpaid+totalunpaid;      // decimalformat df = new decimalformat("0.00");        double percentagepaidamount=((amountpaid/totalamountpaidunpaid)*100);       double percentageunpaidamount=((amountunpaid/totalamountpaidunpaid)*100);       double percentagepaidtotal=((totalpaid/totalnopaidunpaid)*100);       double percentageunpaidtotal=((totalunpaid/totalnopaidunpaid)*100); 

setting piechart:

observablelist<piechart.data> piechartdata3 =                 fxcollections.observablearraylist(                 new piechart.data("paid\n"+(df.format(percentagepaidamount))+"%", amountpaid),                 new piechart.data("unpaid\n"+(df.format(percentageunpaidamount))+"%", amountunpaid));           piechart chart3 = new piechart(piechartdata3);            chart3.getstyleclass().add("chart-legend");                chart3.settitle("payment details[total amount]");         vbox vboxpie3= new vbox();         vboxpie3.getchildren().addall(chart3); 

please suggest solution such labels don't overlap each other.


Comments

Popular posts from this blog

Payment information shows nothing in one page checkout page magento -

tcpdump - How to check if server received packet (acknowledged) -