org.jfree.chart.plot.XYPlot.getRangeAxis()方法的使用及代码示例

x33g5p2x  于2022-02-02 转载在 其他  
字(7.1k)|赞(0)|评价(0)|浏览(131)

本文整理了Java中org.jfree.chart.plot.XYPlot.getRangeAxis()方法的一些代码示例,展示了XYPlot.getRangeAxis()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。XYPlot.getRangeAxis()方法的具体详情如下:
包路径:org.jfree.chart.plot.XYPlot
类名称:XYPlot
方法名:getRangeAxis

XYPlot.getRangeAxis介绍

[英]Returns the range axis for the plot. If the range axis for this plot is null, then the method will return the parent plot's range axis (if there is a parent plot).
[中]返回绘图的范围轴。如果此绘图的范围轴为空,则该方法将返回父绘图的范围轴(如果存在父绘图)。

代码示例

代码示例来源:origin: stackoverflow.com

XYPlot plot = (XYPlot) chart.getPlot();
ValueAxis range = plot.getRangeAxis();
range.setVisible(false);

代码示例来源:origin: stackoverflow.com

Point2D p = chartPanel.translateScreenToJava2D(mouseChartEvent.getTrigger().getPoint());
Rectangle2D plotArea = chartPanel.getScreenDataArea();
XYPlot plot = (XYPlot) chart.getPlot(); // your plot
double chartX = plot.getDomainAxis().java2DToValue(p.getX(), plotArea, plot.getDomainAxisEdge());
double chartY = plot.getRangeAxis().java2DToValue(p.getY(), plotArea, plot.getRangeAxisEdge());

代码示例来源:origin: stackoverflow.com

ValueAxis domain = plot.getDomainAxis();
domain.setAutoRange(true);
ValueAxis range = plot.getRangeAxis();
range.setRange(-MINMAX, MINMAX);
return result;

代码示例来源:origin: stackoverflow.com

final XYPlot plot = getChart().getXYPlot();
final ValueAxis domainAxis = plot.getDomainAxis();
final ValueAxis rangeAxis = plot.getRangeAxis();
final Rectangle2D plotRectangle = SWTUtils.toAwtRectangle(getScreenDataArea());
final double chartX = domainAxis.java2DToValue(relativeX, plotRectangle, plot.getDomainAxisEdge());
final double chartY = rangeAxis.java2DToValue(relativeY, plotRectangle, plot.getRangeAxisEdge());

代码示例来源:origin: stackoverflow.com

domain.setTickUnit(new NumberTickUnit(0.1));
domain.setVerticalTickLabels(true);
NumberAxis range = (NumberAxis) xyPlot.getRangeAxis();
range.setRange(0.0, 1.0);
range.setTickUnit(new NumberTickUnit(0.1));

代码示例来源:origin: stackoverflow.com

JFreeChart chart = functionWhichRetrievesTheChart();
ChartRenderingInfo info = new ChartRenderingInfo();
// PLOT_SIZE is the size if the graph and has to be the same size as the original drawn chart.createBufferedImage(PLOT_SIZE, PLOT_SIZE, info); 
graph, otherwise the pixel position points to somewhere else
PlotRenderingInfo plotInfo = info.getPlotInfo();

XYPlot plot = (XYPlot)chart.getPlot();
Point p = new Point(x,y); // x and y are the pixel positions

// this is the domain value which belongs to the pixel position x
double domain = plot.getDomainAxis().java2DToValue(p.getX(), plotInfo.getDataArea(), plot.getDomainAxisEdge()); 

// this is the range value which belongs to the pixel position y
double range = plot.getRangeAxis().java2DToValue(p.getY(), plotInfo.getDataArea(), plot.getRangeAxisEdge());

代码示例来源:origin: stackoverflow.com

XYPlot xyPlot = jfreechart.getXYPlot();
ValueAxis domainAxis = xyPlot.getDomainAxis();
ValueAxis rangeAxis = xyPlot.getRangeAxis();

domainAxis.setRange(0.0, 1.0);
domainAxis.setTickUnit(new NumberTickUnit(0.1));
rangeAxis.setRange(0.0, 1.0);
rangeAxis.setTickUnit(new NumberTickUnit(0.05));

代码示例来源:origin: stackoverflow.com

renderer.setUseOutlinePaint(true);
renderer.setSeriesOutlinePaint(0, line);
ValueAxis range = plot.getRangeAxis();
range.setLowerBound(0.5);
return new ChartPanel(chart);

代码示例来源:origin: com.hazelcast.simulator/visualiser

@Override
  public void stateChanged(ChangeEvent e) {
    plot.getRangeAxis().setUpperBound(verticalSlider.getValue());
    plot.getRangeAxis().setLowerBound(0);
  }
});

代码示例来源:origin: com.hazelcast.simulator/visualizer

@Override
  public void stateChanged(ChangeEvent e) {
    plot.getRangeAxis().setUpperBound(verticalSlider.getValue());
    plot.getRangeAxis().setLowerBound(0);
  }
});

代码示例来源:origin: stackoverflow.com

private void createChart(XYPlot plot, String fileName, String caption) throws IOException {
  JFreeChart chart = new JFreeChart(caption, plot);
  chart.addSubtitle(this.subtitle);
  if (plot.getRangeAxis() instanceof LogarithmicAxis) {
    chart.addSubtitle(1, new TextTitle("(logarithmische Skala)"));
  }
  File file = new File(fileName);
  file.delete();
  ChartUtilities.saveChartAsPNG(file, chart, CHART_WIDTH, CHART_HEIGHT);
 }

代码示例来源:origin: sc.fiji/TrackMate_

private void resetAxes()
{
  plot.getRangeAxis().setLowerMargin( 0 );
  plot.getRangeAxis().setUpperMargin( 0 );
  plot.getDomainAxis().setLowerMargin( 0 );
  plot.getDomainAxis().setUpperMargin( 0 );
}

代码示例来源:origin: us.ihmc/simulation-construction-set-tools

public void setYAxisRange(double start, double end)
{
 // this needs to be fixed, if setUpGraph is called after this then it overwrites it.
 XYPlot xyplot = graph.getXYPlot();
 NumberAxis numberAxis = (NumberAxis) xyplot.getRangeAxis();
 numberAxis.setRange(new Range(start, end));
}

代码示例来源:origin: org.codehaus.mojo/chronos-report-maven-plugin

public static XYPlot setupXYPlot( JFreeChart chart, DateFormat dateFormat )
{
  XYPlot plot = chart.getXYPlot();
  DateAxis axis = (DateAxis) plot.getDomainAxis();
  axis.setDateFormatOverride( dateFormat );
  NumberAxis rangeAxis = (NumberAxis) plot.getRangeAxis();
  rangeAxis.setStandardTickUnits( NumberAxis.createIntegerTickUnits() );
  return plot;
}

代码示例来源:origin: stackoverflow.com

XYPlot plot = chart.getXYPlot();
NumberAxis xAxis = (NumberAxis) plot.getDomainAxis();
xAxis.setTickUnit(new NumberTickUnit(10));

NumberAxis yAxis = (NumberAxis) plot.getRangeAxis();
yAxis.setTickUnit(new NumberTickUnit(1));

代码示例来源:origin: ca.umontreal.iro/ssj

protected void initAxis(){
 XAxis = new Axis((NumberAxis)((XYPlot)chart.getPlot()).getDomainAxis(),
          Axis.ORIENTATION_HORIZONTAL);
 YAxis = new Axis((NumberAxis)((XYPlot)chart.getPlot()).getRangeAxis(),
          Axis.ORIENTATION_VERTICAL);
 setAutoRange(true, true);
}

代码示例来源:origin: ca.umontreal.iro/ssj

protected void initAxis(){
 XAxis = new Axis((NumberAxis)((XYPlot)chart.getPlot()).getDomainAxis(),
          Axis.ORIENTATION_HORIZONTAL);
 YAxis = new Axis((NumberAxis)((XYPlot)chart.getPlot()).getRangeAxis(),
          Axis.ORIENTATION_VERTICAL);
 setAutoRange(true, true);
}

代码示例来源:origin: com.atlassian.jira/jira-api

public static void setupPlot(XYPlot plot)
{
  plot.setBackgroundPaint(ChartDefaults.transparent);
  plot.setOutlinePaint(ChartDefaults.transparent);
  plot.setRangeGridlinePaint(ChartDefaults.gridLineColor);
  plot.setRangeGridlineStroke(new BasicStroke(0.5f));
  plot.setRangeGridlinesVisible(true);
  plot.setRangeAxisLocation(ChartDefaults.rangeAxisLocation);
  plot.setDomainGridlinesVisible(true);
  ChartUtil.setupRangeAxis(plot.getRangeAxis());
  ChartUtil.setupDomainAxis(plot.getDomainAxis());
}

代码示例来源:origin: com.atlassian.confluence.extra.chart/chart-plugin

public static void setupPlot(XYPlot plot)
{
  plot.setBackgroundPaint(ChartDefaults.transparent);
  plot.setOutlinePaint(ChartDefaults.transparent);
  plot.setRangeGridlinePaint(ChartDefaults.gridLineColor);
  plot.setRangeGridlineStroke(new BasicStroke(0.5f));
  plot.setRangeGridlinesVisible(true);
  plot.setRangeAxisLocation(ChartDefaults.rangeAxisLocation);
  plot.setDomainGridlinesVisible(true);
  ChartUtil.setupRangeAxis(plot.getRangeAxis());
  ChartUtil.setupDomainAxis(plot.getDomainAxis());
}

代码示例来源:origin: de.tudarmstadt.ukp.dkpro.tc/de.tudarmstadt.ukp.dkpro.tc.weka-gpl

@Override
  public void write(OutputStream aStream)
    throws IOException
  {
    JFreeChart chart = ChartFactory.createXYLineChart(null, "Recall", "Precision", dataset,
        PlotOrientation.VERTICAL, false, false, false);
    chart.getXYPlot().setRenderer(new XYSplineRenderer());
    chart.getXYPlot().getRangeAxis().setRange(0.0, 1.0);
    chart.getXYPlot().getDomainAxis().setRange(0.0, 1.0);
    ChartUtil.writeChartAsSVG(aStream, chart, 400, 400);
  }
}

相关文章

微信公众号

最新文章

更多

XYPlot类方法