0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

JFreeChart-レーダーチャート(SpiderWebChart)の作成

Posted at

目次 ⇒ JFreeChartサンプル

package jp.avaj.lib.chart;

import org.jfree.chart.ChartFrame;
import org.jfree.chart.JFreeChart;
import org.jfree.chart.plot.Plot;
import org.jfree.chart.plot.SpiderWebPlot;
import org.jfree.data.category.CategoryDataset;
import org.jfree.data.category.DefaultCategoryDataset;

/**
JFreeChart-レーダーチャート(SpiderWebChart)の作成

 */
public class Chart06_00 {
  // 目次-レーダーチャート(SpiderWebChart)
  A_Chart06 a_Chart06;
  // 目次-Artery-JFreeChart用のライブラリ
  A_Chart00 a_LibChartSampeContents;


  /** 成績のレーダーチャートを作成する */
  public static void main(String[] args) {
    // レーダーチャート(SpiderWebChart)にはCategoryDatasetを使用する
    DefaultCategoryDataset dataset = new DefaultCategoryDataset();
    // Aの成績⇒理系が得意
    dataset.addValue(70,"A","英語");
    dataset.addValue(90,"A","数学");
    dataset.addValue(55,"A","国語");
    dataset.addValue(95,"A","理科");
    dataset.addValue(45,"A","社会");
    // Bの成績⇒文系が得意
    dataset.addValue(100,"B","英語");
    dataset.addValue(60,"B","数学");
    dataset.addValue(80,"B","国語");
    dataset.addValue(55,"B","理科");
    dataset.addValue(70,"B","社会");
    // Cの成績
    dataset.addValue(70,"C","英語");
    dataset.addValue(70,"C","数学");
    dataset.addValue(70,"C","国語");
    dataset.addValue(70,"C","理科");
    dataset.addValue(70,"C","社会");
    //
    // レーダーチャート用のPlotがある
    SpiderWebPlot spiderWebPlot = new SpiderWebPlot((CategoryDataset)dataset);
    //
    JFreeChart jfreeChart = new JFreeChart("成績レーダーチャート",(Plot)spiderWebPlot);
    ChartFrame cFrame = new ChartFrame("成績レーダーチャート",(JFreeChart)jfreeChart);
    cFrame.pack();
    cFrame.setVisible(true);
  }
}

無題.png

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?