本文整理汇总了Java中org.jfree.chart.axis.NumberAxis.setAxisLineVisible方法的典型用法代码示例。如果您正苦于以下问题:Java NumberAxis.setAxisLineVisible方法的具体用法?Java NumberAxis.setAxisLineVisible怎么用?Java NumberAxis.setAxisLineVisible使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.jfree.chart.axis.NumberAxis
的用法示例。
在下文中一共展示了NumberAxis.setAxisLineVisible方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createPolarChart
import org.jfree.chart.axis.NumberAxis; //导入方法依赖的package包/类
/**
* Creates a polar plot for the specified dataset (x-values interpreted as
* angles in degrees). The chart object returned by this method uses a
* {@link PolarPlot} instance as the plot, with a {@link NumberAxis} for
* the radial axis.
*
* @param title the chart title (<code>null</code> permitted).
* @param dataset the dataset (<code>null</code> permitted).
* @param legend legend required?
* @param tooltips tooltips required?
* @param urls URLs required?
*
* @return A chart.
*/
public static JFreeChart createPolarChart(String title,
XYDataset dataset,
boolean legend,
boolean tooltips,
boolean urls) {
PolarPlot plot = new PolarPlot();
plot.setDataset(dataset);
NumberAxis rangeAxis = new NumberAxis();
rangeAxis.setAxisLineVisible(false);
rangeAxis.setTickMarksVisible(false);
rangeAxis.setTickLabelInsets(new RectangleInsets(0.0, 0.0, 0.0, 0.0));
plot.setAxis(rangeAxis);
plot.setRenderer(new DefaultPolarItemRenderer());
JFreeChart chart = new JFreeChart(
title, JFreeChart.DEFAULT_TITLE_FONT, plot, legend);
return chart;
}
示例2: createPolarChart
import org.jfree.chart.axis.NumberAxis; //导入方法依赖的package包/类
/**
* Creates a polar plot for the specified dataset (x-values interpreted as angles in degrees).
* <P>
* The chart object returned by this method uses a {@link PolarPlot} instance as the
* plot, with a {@link NumberAxis} for the radial axis.
*
* @param title the chart title (<code>null</code> permitted).
* @param dataset the dataset (<code>null</code> permitted).
* @param legend legend required?
* @param tooltips tooltips required?
* @param urls URLs required?
*
* @return A chart.
*/
public static JFreeChart createPolarChart(String title,
XYDataset dataset,
boolean legend,
boolean tooltips,
boolean urls) {
PolarPlot plot = new PolarPlot();
plot.setDataset(dataset);
NumberAxis rangeAxis = new NumberAxis();
rangeAxis.setAxisLineVisible(false);
rangeAxis.setTickMarksVisible(false);
rangeAxis.setTickLabelInsets(new Insets(0, 0, 0, 0));
plot.setRadialAxis(rangeAxis);
plot.setRenderer(new DefaultPolarItemRenderer());
JFreeChart chart = new JFreeChart(title, JFreeChart.DEFAULT_TITLE_FONT, plot, legend);
return chart;
}
示例3: ThermometerPlot
import org.jfree.chart.axis.NumberAxis; //导入方法依赖的package包/类
/**
* Creates a new thermometer plot, using default attributes where necessary.
*
* @param dataset the data set.
*/
public ThermometerPlot(ValueDataset dataset) {
super();
this.padding = new Spacer(Spacer.RELATIVE, 0.05, 0.05, 0.05, 0.05);
this.dataset = dataset;
if (dataset != null) {
dataset.addChangeListener(this);
}
NumberAxis axis = new NumberAxis(null);
axis.setStandardTickUnits(NumberAxis.createIntegerTickUnits());
axis.setAxisLineVisible(false);
setRangeAxis(axis);
setAxisRange();
}
示例4: ThermometerPlot
import org.jfree.chart.axis.NumberAxis; //导入方法依赖的package包/类
/**
* Creates a new thermometer plot, using default attributes where necessary.
*
* @param dataset the data set.
*/
public ThermometerPlot(ValueDataset dataset) {
super();
this.padding = new RectangleInsets(UnitType.RELATIVE, 0.05, 0.05, 0.05,
0.05);
this.dataset = dataset;
if (dataset != null) {
dataset.addChangeListener(this);
}
NumberAxis axis = new NumberAxis(null);
axis.setStandardTickUnits(NumberAxis.createIntegerTickUnits());
axis.setAxisLineVisible(false);
setRangeAxis(axis);
setAxisRange();
}
示例5: GraphGenerator
import org.jfree.chart.axis.NumberAxis; //导入方法依赖的package包/类
public GraphGenerator(final String title, AthenaFeatures athenaFeatures, String feature) {
super(title);
this.feature = feature;
final XYDataset dataset = createDatasetFromFeatureData(athenaFeatures, feature);
final JFreeChart chart = createChart(dataset);
chart.setTitle("");
LegendTitle legend = (LegendTitle) chart.getLegend();
chart.removeLegend();
Font nwfont = new Font("Arial",1,12);
legend.setItemFont(nwfont);
legend.setPosition(RectangleEdge.TOP);
// legend.setWidth(200);
legend.setItemLabelPadding(new RectangleInsets(3, 3, 3, 3));
legend.setHeight(10);
// legend.setPadding(new RectangleInsets(10, 10, 10, 10));
XYTitleAnnotation ta = new XYTitleAnnotation(0.99, 0.98, legend, RectangleAnchor.TOP_RIGHT);
ta.setMaxWidth(0.95);
// chart.addLegend(legend);
XYPlot plot = (XYPlot) chart.getPlot();
plot.setBackgroundPaint(Color.white);
plot.setDomainZeroBaselinePaint(Color.gray);
plot.setDomainGridlinePaint(Color.gray);
plot.setDomainGridlineStroke(new BasicStroke(0.7f));
plot.setRangeGridlinePaint(Color.gray);
plot.setRangeGridlineStroke(new BasicStroke(0.7f));
plot.setDomainMinorGridlinePaint(Color.black);
plot.addAnnotation(ta);
final XYLineAndShapeRenderer renderer = new XYLineAndShapeRenderer();
renderer.setSeriesPaint(0, Color.black);
renderer.setSeriesShape(0, ShapeUtilities.createDiamond(5));
renderer.setSeriesPaint(1, Color.red);
renderer.setSeriesShape(1, ShapeUtilities.createUpTriangle(5));
renderer.setSeriesPaint(2, Color.blue);
Shape shape = new Ellipse2D.Double(-5.0,-5.0,10,10);
renderer.setSeriesShape(2, shape);
renderer.setShapesFilled(false);
// renderer.setSeriesShapesVisible(1, false);
//apply theme
// StandardChartTheme.createJFreeTheme().apply(chart);
plot.setRenderer(renderer);
NumberAxis yAxis = (NumberAxis) plot.getRangeAxis();
yAxis.setLabel(feature + " (K)");
yAxis.setAxisLineVisible(false);
yAxis.setTickUnit(new NumberTickUnit(50000));
yAxis.setNumberFormatOverride(new ByteFormat());
yAxis.setRange(new Range(0, 160000));
plot.getRenderer().setBaseItemLabelsVisible(true);
DateAxis xAxis = (DateAxis) plot.getDomainAxis();
xAxis.setAxisLineVisible(false);
xAxis.setDateFormatOverride(new SimpleDateFormat("yyyy-MM-dd-HH:mm:ss"));
xAxis.setTickUnit(new DateTickUnit(DateTickUnit.MINUTE, 3));
xAxis.setLabelFont(new Font("Arial",1,12));
final ChartPanel chartPanel = new ChartPanel(chart);
chartPanel.setPreferredSize(new java.awt.Dimension(631, 381));
chartPanel.setMouseZoomable(true, true);
setContentPane(chartPanel);
try {
ChartUtilities.saveChartAsPNG(new File("result.png"), chart, 631, 381);
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}