radar graph in java

radar graph in java

Hi All I am developing a java application. In this application i need to show a radar grap.when some body assigne rating then each rating should show on x y z axis. please suggest me some good way to do this task. Thanks Yogi

View Answers

December 9, 2010 at 12:59 PM

Hi Friend,

Try the following code:

import java.awt.*;
import org.jfree.ui.*;
import org.jfree.chart.*;
import org.jfree.chart.plot.*;
import org.jfree.chart.labels.*;
import org.jfree.chart.title.*;
import org.jfree.data.category.*;

  public class RadarChart extends ApplicationFrame {
    public DefaultCategoryDataset dataset;
    public SpiderWebPlot plot;
    public RadarChart(String title) {
        super(title);
        String series1 = "First";
        String series2 = "Second";
        String series3 = "Third";

        String category1 = "Category 1";
        String category2 = "Category 2";
        String category3 = "Category 3";
        String category4 = "Category 4";
        String category5 = "Category 5";

        DefaultCategoryDataset dataset = new DefaultCategoryDataset();
        dataset.addValue(1.0, series1, category1);
        dataset.addValue(4.0, series1, category2);
        dataset.addValue(3.0, series1, category3);
        dataset.addValue(5.0, series1, category4);
        dataset.addValue(5.0, series1, category5);

        dataset.addValue(5.0, series2, category1);
        dataset.addValue(7.0, series2, category2);
        dataset.addValue(6.0, series2, category3);
        dataset.addValue(8.0, series2, category4);
        dataset.addValue(4.0, series2, category5);

        dataset.addValue(4.0, series3, category1);
        dataset.addValue(3.0, series3, category2);
        dataset.addValue(2.0, series3, category3);
        dataset.addValue(3.0, series3, category4);
        dataset.addValue(6.0, series3, category5);
        SpiderWebPlot plot = new SpiderWebPlot(dataset);
        plot.setStartAngle(54);
        plot.setInteriorGap(0.40);
        plot.setToolTipGenerator(new StandardCategoryToolTipGenerator());
        JFreeChart chart = new JFreeChart("", TextTitle.DEFAULT_FONT, plot, false);
        ChartUtilities.applyCurrentTheme(chart);
            ChartPanel chartPanel = new ChartPanel(chart);
        this.plot = (SpiderWebPlot) chartPanel.getChart().getPlot();
        this.dataset = (DefaultCategoryDataset) plot.getDataset();
        chartPanel.setPreferredSize(new Dimension(500, 270));
        setContentPane(chartPanel);
        }
        public static void main(String[] args) {
        RadarChart demo = new RadarChart("Chart");
        demo.pack();
        RefineryUtilities.centerFrameOnScreen(demo);
        demo.setVisible(true);
          }
}

Here we have used jfreechart api.

Thanks









Related Tutorials/Questions & Answers:
radar graph in java
radar graph in java  Hi All I am developing a java application. In this application i need to show a radar grap.when some body assigne rating then each rating should show on x y z axis. please suggest me some good way to do
Graph in JAVA SWING
Graph in JAVA SWING  Hi, How to draw a simple GRAPH in JAVA SWING ?  ..., Please visit the following link: Bar Graph in Java Swing Thanks
Advertisements
plot a graph in Java
plot a graph in Java   I need to plot a graph in Java but the samples are not known in advance. The samples keep on coming through callback and I... and the final graph may be quite congested. So please guide me on this. Thanks
plotting a graph - Java Beginners
plotting a graph  pls help me out regarding plotting a graph. I have done that through LiveGraph API. but now i required the graph to be displayed on the gui- window. and whatever inputs i will pass it must change the graph
java-graph help - Java Beginners
java-graph help  sir/madam I wanted to design a shortest path Algorithm. i wanted to show the shortest path in graphical format in the way it looks in the books.I have drawn circlec and lines between the circles but am not able
Graph
Graph  What is the code to generate the following graphs? 1.Simple Bar diagram 2.Sub-divided Bar diagram 3.Pie chart Please Help!!!!   Please visit the following link: Java charts and graphs
java + excel data +graph - JDBC
java + excel data +graph  i am doin' a project in which i need... a graph with the facility of drawing a trendline(in the graph)...also i need to be able to select points in the graph and draw the graph again between those
Multi line graph - Java Beginners
Multi line graph  Hi, I want a multi line graph on a single chart using jfree in java.... Can you please let me know the code... thanks in advance  Hi Friend, Loginto the below mentioned URl & download the file
Maven dependency for com.cedexis - android-radar version 0.1.7 is released. Learn to use android-radar version 0.1.7 in Maven based Java projects
this version ( com.cedexis - android-radar version 0.1.7 ) in their Java project... that downloads and includes  com.cedexis - android-radar version 0.1.7 java library...Maven dependency for  com.cedexis  - Version 0.1.7 of android-radar
Maven dependency for com.cedexis - android-radar version 0.1.6 is released. Learn to use android-radar version 0.1.6 in Maven based Java projects
this version ( com.cedexis - android-radar version 0.1.6 ) in their Java project... that downloads and includes  com.cedexis - android-radar version 0.1.6 java library...Maven dependency for  com.cedexis  - Version 0.1.6 of android-radar
Maven dependency for com.cedexis - android-radar version 0.1.5 is released. Learn to use android-radar version 0.1.5 in Maven based Java projects
this version ( com.cedexis - android-radar version 0.1.5 ) in their Java project... that downloads and includes  com.cedexis - android-radar version 0.1.5 java library...Maven dependency for  com.cedexis  - Version 0.1.5 of android-radar
Maven dependency for com.cedexis - android-radar version 0.1.4 is released. Learn to use android-radar version 0.1.4 in Maven based Java projects
this version ( com.cedexis - android-radar version 0.1.4 ) in their Java project... that downloads and includes  com.cedexis - android-radar version 0.1.4 java library...Maven dependency for  com.cedexis  - Version 0.1.4 of android-radar
Maven dependency for com.cedexis - android-radar version 0.1.3 is released. Learn to use android-radar version 0.1.3 in Maven based Java projects
this version ( com.cedexis - android-radar version 0.1.3 ) in their Java project... that downloads and includes  com.cedexis - android-radar version 0.1.3 java library...Maven dependency for  com.cedexis  - Version 0.1.3 of android-radar
Maven dependency for com.mparticle - android-radar-kit version 5.10.0 is released. Learn to use android-radar-kit version 5.10.0 in Maven based Java projects
; com.mparticle - android-radar-kit version 5.10.0 in Java projects. Follow... and includes  com.mparticle - android-radar-kit version 5.10.0 java library in your...-radar-kit released The developers of   com.mparticle - android-radar-kit
Maven dependency for com.mparticle - android-radar-kit version 5.9.2 is released. Learn to use android-radar-kit version 5.9.2 in Maven based Java projects
; com.mparticle - android-radar-kit version 5.9.2 in Java projects. Follow the step...; com.mparticle - android-radar-kit version 5.9.2 java library in your project...-radar-kit released The developers of   com.mparticle - android-radar-kit
Maven dependency for com.mparticle - android-radar-kit version 4.15.4 is released. Learn to use android-radar-kit version 4.15.4 in Maven based Java projects
; com.mparticle - android-radar-kit version 4.15.4 in Java projects. Follow... and includes  com.mparticle - android-radar-kit version 4.15.4 java library in your...-radar-kit released The developers of   com.mparticle - android-radar-kit
Maven dependency for com.mparticle - android-radar-kit version 4.10.0 is released. Learn to use android-radar-kit version 4.10.0 in Maven based Java projects
; com.mparticle - android-radar-kit version 4.10.0 in Java projects. Follow... and includes  com.mparticle - android-radar-kit version 4.10.0 java library in your...-radar-kit released The developers of   com.mparticle - android-radar-kit
Maven dependency for com.mparticle - android-radar-kit version 5.9.7 is released. Learn to use android-radar-kit version 5.9.7 in Maven based Java projects
; com.mparticle - android-radar-kit version 5.9.7 in Java projects. Follow the step...; com.mparticle - android-radar-kit version 5.9.7 java library in your project...-radar-kit released The developers of   com.mparticle - android-radar-kit
Maven dependency for com.mparticle - android-radar-kit version 5.4.0 is released. Learn to use android-radar-kit version 5.4.0 in Maven based Java projects
; com.mparticle - android-radar-kit version 5.4.0 in Java projects. Follow the step...; com.mparticle - android-radar-kit version 5.4.0 java library in your project...-radar-kit released The developers of   com.mparticle - android-radar-kit
Maven dependency for com.mparticle - android-radar-kit version 5.12.3 is released. Learn to use android-radar-kit version 5.12.3 in Maven based Java projects
; com.mparticle - android-radar-kit version 5.12.3 in Java projects. Follow... and includes  com.mparticle - android-radar-kit version 5.12.3 java library in your...-radar-kit released The developers of   com.mparticle - android-radar-kit
Maven dependency for com.mparticle - android-radar-kit version 5.16.2 is released. Learn to use android-radar-kit version 5.16.2 in Maven based Java projects
; com.mparticle - android-radar-kit version 5.16.2 in Java projects. Follow... and includes  com.mparticle - android-radar-kit version 5.16.2 java library in your...-radar-kit released The developers of   com.mparticle - android-radar-kit
Maven dependency for com.mparticle - android-radar-kit version 4.11.0 is released. Learn to use android-radar-kit version 4.11.0 in Maven based Java projects
; com.mparticle - android-radar-kit version 4.11.0 in Java projects. Follow... and includes  com.mparticle - android-radar-kit version 4.11.0 java library in your...-radar-kit released The developers of   com.mparticle - android-radar-kit
Maven dependency for com.mparticle - android-radar-kit version 5.6.2 is released. Learn to use android-radar-kit version 5.6.2 in Maven based Java projects
; com.mparticle - android-radar-kit version 5.6.2 in Java projects. Follow the step...; com.mparticle - android-radar-kit version 5.6.2 java library in your project...-radar-kit released The developers of   com.mparticle - android-radar-kit
Maven dependency for com.mparticle - android-radar-kit version 5.9.8 is released. Learn to use android-radar-kit version 5.9.8 in Maven based Java projects
; com.mparticle - android-radar-kit version 5.9.8 in Java projects. Follow the step...; com.mparticle - android-radar-kit version 5.9.8 java library in your project...-radar-kit released The developers of   com.mparticle - android-radar-kit
Maven dependency for com.mparticle - android-radar-kit version 4.16.7 is released. Learn to use android-radar-kit version 4.16.7 in Maven based Java projects
; com.mparticle - android-radar-kit version 4.16.7 in Java projects. Follow... and includes  com.mparticle - android-radar-kit version 4.16.7 java library in your...-radar-kit released The developers of   com.mparticle - android-radar-kit
Maven dependency for com.mparticle - android-radar-kit version 5.3.5 is released. Learn to use android-radar-kit version 5.3.5 in Maven based Java projects
; com.mparticle - android-radar-kit version 5.3.5 in Java projects. Follow the step...; com.mparticle - android-radar-kit version 5.3.5 java library in your project...-radar-kit released The developers of   com.mparticle - android-radar-kit
Maven dependency for com.mparticle - android-radar-kit version 5.14.16 is released. Learn to use android-radar-kit version 5.14.16 in Maven based Java projects
to use  com.mparticle - android-radar-kit version 5.14.16 in Java projects. Follow... and includes  com.mparticle - android-radar-kit version 5.14.16 java library...-radar-kit released The developers of   com.mparticle - android-radar
Maven dependency for com.mparticle - android-radar-kit version 5.6.1 is released. Learn to use android-radar-kit version 5.6.1 in Maven based Java projects
; com.mparticle - android-radar-kit version 5.6.1 in Java projects. Follow the step...; com.mparticle - android-radar-kit version 5.6.1 java library in your project...-radar-kit released The developers of   com.mparticle - android-radar-kit
Maven dependency for com.mparticle - android-radar-kit version 5.6.5 is released. Learn to use android-radar-kit version 5.6.5 in Maven based Java projects
; com.mparticle - android-radar-kit version 5.6.5 in Java projects. Follow the step...; com.mparticle - android-radar-kit version 5.6.5 java library in your project...-radar-kit released The developers of   com.mparticle - android-radar-kit
Maven dependency for com.mparticle - android-radar-kit version 4.17.1 is released. Learn to use android-radar-kit version 4.17.1 in Maven based Java projects
; com.mparticle - android-radar-kit version 4.17.1 in Java projects. Follow... and includes  com.mparticle - android-radar-kit version 4.17.1 java library in your...-radar-kit released The developers of   com.mparticle - android-radar-kit
Maven dependency for com.mparticle - android-radar-kit version 5.3.4 is released. Learn to use android-radar-kit version 5.3.4 in Maven based Java projects
; com.mparticle - android-radar-kit version 5.3.4 in Java projects. Follow the step...; com.mparticle - android-radar-kit version 5.3.4 java library in your project...-radar-kit released The developers of   com.mparticle - android-radar-kit
Maven dependency for com.mparticle - android-radar-kit version 4.10.4 is released. Learn to use android-radar-kit version 4.10.4 in Maven based Java projects
; com.mparticle - android-radar-kit version 4.10.4 in Java projects. Follow... and includes  com.mparticle - android-radar-kit version 4.10.4 java library in your...-radar-kit released The developers of   com.mparticle - android-radar-kit
Maven dependency for com.mparticle - android-radar-kit version 5.12.1 is released. Learn to use android-radar-kit version 5.12.1 in Maven based Java projects
; com.mparticle - android-radar-kit version 5.12.1 in Java projects. Follow... and includes  com.mparticle - android-radar-kit version 5.12.1 java library in your...-radar-kit released The developers of   com.mparticle - android-radar-kit
Maven dependency for com.mparticle - android-radar-kit version 4.17.4 is released. Learn to use android-radar-kit version 4.17.4 in Maven based Java projects
; com.mparticle - android-radar-kit version 4.17.4 in Java projects. Follow... and includes  com.mparticle - android-radar-kit version 4.17.4 java library in your...-radar-kit released The developers of   com.mparticle - android-radar-kit
Maven dependency for com.mparticle - android-radar-kit version 5.41.3 is released. Learn to use android-radar-kit version 5.41.3 in Maven based Java projects
to use  com.mparticle - android-radar-kit version 5.41.3 in Java projects...-radar-kit released The developers of   com.mparticle - android-radar..., the released version of  com.mparticle - android-radar-kit library
Maven dependency for com.mparticle - android-radar-kit version 5.9.4 is released. Learn to use android-radar-kit version 5.9.4 in Maven based Java projects
to use  com.mparticle - android-radar-kit version 5.9.4 in Java projects. Follow...-radar-kit released The developers of   com.mparticle - android-radar..., the released version of  com.mparticle - android-radar-kit library is 5.9.4.
Maven dependency for com.mparticle - android-radar-kit version 5.53.0 is released. Learn to use android-radar-kit version 5.53.0 in Maven based Java projects
to use  com.mparticle - android-radar-kit version 5.53.0 in Java projects...-radar-kit released The developers of   com.mparticle - android-radar..., the released version of  com.mparticle - android-radar-kit library
Maven dependency for com.mparticle - android-radar-kit version 4.10.6 is released. Learn to use android-radar-kit version 4.10.6 in Maven based Java projects
to use  com.mparticle - android-radar-kit version 4.10.6 in Java projects...-radar-kit released The developers of   com.mparticle - android-radar..., the released version of  com.mparticle - android-radar-kit library
Maven dependency for com.mparticle - android-radar-kit version 5.11.3 is released. Learn to use android-radar-kit version 5.11.3 in Maven based Java projects
to use  com.mparticle - android-radar-kit version 5.11.3 in Java projects...-radar-kit released The developers of   com.mparticle - android-radar..., the released version of  com.mparticle - android-radar-kit library
Maven dependency for com.mparticle - android-radar-kit version 5.28.0 is released. Learn to use android-radar-kit version 5.28.0 in Maven based Java projects
to use  com.mparticle - android-radar-kit version 5.28.0 in Java projects...-radar-kit released The developers of   com.mparticle - android-radar..., the released version of  com.mparticle - android-radar-kit library
Maven dependency for com.mparticle - android-radar-kit version 5.19.0 is released. Learn to use android-radar-kit version 5.19.0 in Maven based Java projects
to use  com.mparticle - android-radar-kit version 5.19.0 in Java projects...-radar-kit released The developers of   com.mparticle - android-radar..., the released version of  com.mparticle - android-radar-kit library
Maven dependency for com.mparticle - android-radar-kit version 5.47.2 is released. Learn to use android-radar-kit version 5.47.2 in Maven based Java projects
to use  com.mparticle - android-radar-kit version 5.47.2 in Java projects...-radar-kit released The developers of   com.mparticle - android-radar..., the released version of  com.mparticle - android-radar-kit library
Maven dependency for com.mparticle - android-radar-kit version 5.51.3 is released. Learn to use android-radar-kit version 5.51.3 in Maven based Java projects
to use  com.mparticle - android-radar-kit version 5.51.3 in Java projects...-radar-kit released The developers of   com.mparticle - android-radar..., the released version of  com.mparticle - android-radar-kit library
Maven dependency for com.mparticle - android-radar-kit version 5.16.6 is released. Learn to use android-radar-kit version 5.16.6 in Maven based Java projects
to use  com.mparticle - android-radar-kit version 5.16.6 in Java projects...-radar-kit released The developers of   com.mparticle - android-radar..., the released version of  com.mparticle - android-radar-kit library
Maven dependency for com.mparticle - android-radar-kit version 5.34.0 is released. Learn to use android-radar-kit version 5.34.0 in Maven based Java projects
to use  com.mparticle - android-radar-kit version 5.34.0 in Java projects...-radar-kit released The developers of   com.mparticle - android-radar..., the released version of  com.mparticle - android-radar-kit library
Maven dependency for com.mparticle - android-radar-kit version 4.17.2 is released. Learn to use android-radar-kit version 4.17.2 in Maven based Java projects
to use  com.mparticle - android-radar-kit version 4.17.2 in Java projects...-radar-kit released The developers of   com.mparticle - android-radar..., the released version of  com.mparticle - android-radar-kit library
Maven dependency for com.mparticle - android-radar-kit version 4.17.3 is released. Learn to use android-radar-kit version 4.17.3 in Maven based Java projects
to use  com.mparticle - android-radar-kit version 4.17.3 in Java projects...-radar-kit released The developers of   com.mparticle - android-radar..., the released version of  com.mparticle - android-radar-kit library
make chart or graph from database - Java Beginners
make chart or graph from database  d, I want to ask about how to make a chart or graph. First i have Table name= "customer" and field =(cust_id... I am sending a link where u find many example related to chart and graph
Ask make graph from i report and view to java Language Programming
Ask make graph from i report and view to java Language Programming  Dear sir, Please help me, i want to make a graph from mysql to i report and view to java. Please help me, give me example source code please. thank you
ModuleNotFoundError: No module named 'radar'
ModuleNotFoundError: No module named 'radar'  Hi, My Python program is throwing following error: ModuleNotFoundError: No module named 'radar' How to remove the ModuleNotFoundError: No module named 'radar'

Ads