0

Starting from the java code below , is there a way to add text on jfree plot ?

The aim is to obtain a plot like posted with "aa" "bb "cc" .

"filling text ................."

Thank you tinitus

package jfreechart;

import javax.swing.JFrame;
import org.jfree.chart.ChartFactory;
import org.jfree.chart.ChartPanel;
import org.jfree.chart.JFreeChart;
import org.jfree.data.category.DefaultCategoryDataset;
import org.jfree.data.xy.XYSeries;
import org.jfree.data.xy.XYSeriesCollection;

public class JFreeChartPolarChartExample2 extends JFrame {

   private static final long serialVersionUID = 1L;
   public JFreeChartPolarChartExample2(String applicationTitle) {
       super(applicationTitle);
    
       XYSeriesCollection  dataSet1 = new XYSeriesCollection();
       JFreeChart jfreeChart = ChartFactory.createPolarChart(null, dataSet1, true, true, false);
       
       final XYSeries series = new XYSeries(" serie1");
           series.add(10, 0.90);
           series.add(100, 0.10);
           series.add(195, 0.50);
           series.add(295, 0.50);
           dataSet1.addSeries(series);    

       PolarPlot polarPlot = (PolarPlot) jfreeChart.getPlot();  
       
       ChartPanel chartPanel = new ChartPanel(jfreeChart);
       chartPanel.setPreferredSize(new java.awt.Dimension(500, 500));
       setContentPane(chartPanel);
   
   }
    
   public static void main(String[] args) {
       JFreeChartPolarChartExample2 chart = new JFreeChartPolarChartExample2(null);
       chart.pack();
       chart.setVisible(true);
   }
}

enter image description here

froggy
  • 496
  • 2
  • 6
  • 17

0 Answers0