コード例 #1
0
 private static JFreeChart createChart() {
   XYDataset xydataset = createDirectionDataset(600);
   JFreeChart jfreechart =
       ChartFactory.createTimeSeriesChart(
           "Time", "Date", "Direction", xydataset, true, true, false);
   XYPlot xyplot = (XYPlot) jfreechart.getPlot();
   xyplot.getDomainAxis().setLowerMargin(0.0D);
   xyplot.getDomainAxis().setUpperMargin(0.0D);
   NumberAxis numberaxis = (NumberAxis) xyplot.getRangeAxis();
   numberaxis.setAutoRangeIncludesZero(false);
   TickUnits tickunits = new TickUnits();
   tickunits.add(new NumberTickUnit(180D, new CompassFormat()));
   tickunits.add(new NumberTickUnit(90D, new CompassFormat()));
   tickunits.add(new NumberTickUnit(45D, new CompassFormat()));
   tickunits.add(new NumberTickUnit(22.5D, new CompassFormat()));
   numberaxis.setStandardTickUnits(tickunits);
   xyplot.setRangeAxis(numberaxis);
   XYAreaRenderer xyarearenderer = new XYAreaRenderer();
   NumberAxis numberaxis1 = new NumberAxis("Force");
   numberaxis1.setRange(0.0D, 12D);
   xyarearenderer.setSeriesPaint(0, new Color(0, 0, 255, 128));
   xyplot.setDataset(1, createForceDataset(600));
   xyplot.setRenderer(1, xyarearenderer);
   xyplot.setRangeAxis(1, numberaxis1);
   xyplot.mapDatasetToRangeAxis(1, 1);
   return jfreechart;
 }