title: Labels representing the different sections of a Piechart are overlapping with one another
body: <p>I am developing a <em>JaxaFX</em> application that generates reports by taking data from a <em>MySQL</em> database. I came across an issue when working with piecharts. Whenever the fetched data is <code>0</code>, the label getting displayed for it <strong>overlaps with the other labels</strong> in the piechart making it difficult to read.</p>
  
  <p><img src="https://i.stack.imgur.com/4vKt4.jpg" alt="Overlapping labels in a piechart"></p>
  
  <p>Relevant bits of Code:</p>
  
  <p>Fetching the Data:</p>
  
  <pre><code>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);
  </code></pre>
  
  <p>Setting the Piechart:</p>
  
  <pre><code>ObservableList&lt;PieChart.Data&gt; 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);
  </code></pre>
  
  <p>Please suggest a solution such that the labels don't overlap with each other.</p>