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

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

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

XYPlot.addAnnotation介绍

[英]Adds an annotation to the plot and sends a PlotChangeEvent to all registered listeners.
[中]向绘图添加注释,并向所有注册的侦听器发送PlotChangeEvent。

代码示例

代码示例来源:origin: jfree/jfreechart

/**
 * Adds an annotation to the plot and sends a {@link PlotChangeEvent} to
 * all registered listeners.
 *
 * @param annotation  the annotation ({@code null} not permitted).
 *
 * @see #getAnnotations()
 * @see #removeAnnotation(XYAnnotation)
 */
public void addAnnotation(XYAnnotation annotation) {
  addAnnotation(annotation, true);
}

代码示例来源:origin: org.codehaus.jtstand/jtstand-chart

/**
 * Adds an annotation to the plot and sends a {@link PlotChangeEvent} to
 * all registered listeners.
 *
 * @param annotation  the annotation (<code>null</code> not permitted).
 *
 * @see #getAnnotations()
 * @see #removeAnnotation(XYAnnotation)
 */
public void addAnnotation(XYAnnotation annotation) {
  addAnnotation(annotation, true);
}

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

XYPlot plot = (XYPlot) chart.getPlot();
plot.addAnnotation(a);

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

double x = 150;
double y = 300;
XYPlot plot = chart.getXYPlot();
ImageIcon imageIcon = new ImageIcon("/path/to/your/icon.png");
XYAnnotation xyannotation = new XYImageAnnotation(x, y, imageIcon.getImage());
plot.addAnnotation(xyannotation);

代码示例来源:origin: superad/pdf-kit

xyplot.addAnnotation(box00);
xyplot.addAnnotation(box01);
xyplot.addAnnotation(box02);
xyplot.addAnnotation(box10);
xyplot.addAnnotation(box11);
xyplot.addAnnotation(box12);
xyplot.addAnnotation(box20);
xyplot.addAnnotation(box21);
xyplot.addAnnotation(box22);
text4.setPaint(new Color(20, 149, 134));
xyplot.addAnnotation(text1);
xyplot.addAnnotation(text2);
xyplot.addAnnotation(text3);
xyplot.addAnnotation(text4);

代码示例来源:origin: senbox-org/snap-desktop

private void addAnnotation() {
  selectedArea = new SelectedArea(createShape(), fillPaint);
  chartPanel.getChart().getXYPlot().addAnnotation(selectedArea);
}

代码示例来源:origin: bcdev/beam

private void addAnnotation() {
  selectedArea = new SelectedArea(createShape(), fillPaint);
  chartPanel.getChart().getXYPlot().addAnnotation(selectedArea);
}

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

plot.addAnnotation(line);
Arc2D.Double arc = new Arc2D.Double(X, Y, W, 2 * H, PI, PI, Arc2D.OPEN);
plot.addAnnotation(new XYShapeAnnotation(arc, stroke, blue));

代码示例来源:origin: superad/pdf-kit

/**
 * @description 初始化数据标签
 */
private static void initDataLabels(JFreeChart jfreechart, List<XYScatter> dataList) {
  //数据录入
  if(dataList==null ||dataList.size()==0){
    return;
  }
  XYPlot xyplot = (XYPlot) jfreechart.getPlot();
  for(XYScatter xyScatter:dataList){
    XYPointerFrameAnnotation pointerAnnotation=new XYPointerFrameAnnotation(
        xyScatter.getLabel(),
        xyScatter.getX(),
        xyScatter.getY(),
        turnTop
        );
    pointerAnnotation.setFont(FontUtil.getFont(Font.PLAIN, 13));
    xyplot.addAnnotation(pointerAnnotation);
  }
}

代码示例来源:origin: senbox-org/snap-desktop

private void setPlotMessage(String messageText) {
  chart.getXYPlot().clearAnnotations();
  TextTitle tt = new TextTitle(messageText);
  tt.setTextAlignment(HorizontalAlignment.RIGHT);
  tt.setFont(chart.getLegend().getItemFont());
  tt.setBackgroundPaint(new Color(200, 200, 255, 50));
  tt.setFrame(new BlockBorder(Color.white));
  tt.setPosition(RectangleEdge.BOTTOM);
  XYTitleAnnotation message = new XYTitleAnnotation(0.5, 0.5, tt, RectangleAnchor.CENTER);
  chart.getXYPlot().addAnnotation(message);
}

代码示例来源:origin: GrammarViz2/grammarviz2_src

this.timeseriesPlot.addAnnotation(a);

代码示例来源:origin: net.imagej/imagej-ui-swing

/**
 * Returns a JFreeChart containing data from the provided histogram.
 */
private JFreeChart getChart(final String title, final HistogramBundle bund) {
  List<XYSeries> series = new ArrayList<>();
  for (int h = 0; h < bund.getHistogramCount(); h++) {
    final XYSeries xys = new XYSeries("histo" + h);
    final long total = bund.getHistogram(h).getBinCount();
    for (long i = 0; i < total; i++) {
      xys.add(i, bund.getHistogram(h).frequency(i));
    }
    series.add(xys);
  }
  final JFreeChart chart = createChart(title, series);
  if (bund.getMinBin() != -1) {
    chart.getXYPlot().addDomainMarker(
      new ValueMarker(bund.getMinBin(), Color.black, new BasicStroke(1)));
  }
  if (bund.getMaxBin() != -1) {
    chart.getXYPlot().addDomainMarker(
      new ValueMarker(bund.getMaxBin(), Color.black, new BasicStroke(1)));
  }
  if (displaySlopeLine(bund)) {
    chart.getXYPlot().addAnnotation(slopeLine());
  }
  return chart;
}

代码示例来源:origin: bcdev/beam

private void setPlotMessage(String messageText) {
  chart.getXYPlot().clearAnnotations();
  TextTitle tt = new TextTitle(messageText);
  tt.setTextAlignment(HorizontalAlignment.RIGHT);
  tt.setFont(chart.getLegend().getItemFont());
  tt.setBackgroundPaint(new Color(200, 200, 255, 50));
  tt.setFrame(new BlockBorder(Color.white));
  tt.setPosition(RectangleEdge.BOTTOM);
  XYTitleAnnotation message = new XYTitleAnnotation(0.5, 0.5, tt, RectangleAnchor.CENTER);
  chart.getXYPlot().addAnnotation(message);
}

代码示例来源:origin: bcdev/beam

void updateAnnotation(RasterDataNode raster) {
  removeAnnotation();
  final AbstractTimeSeries timeSeries = getTimeSeries();
  TimeCoding timeCoding = timeSeries.getRasterTimeMap().get(raster);
  if (timeCoding != null) {
    final ProductData.UTC startTime = timeCoding.getStartTime();
    final Millisecond timePeriod = new Millisecond(startTime.getAsDate(),
        ProductData.UTC.UTC_TIME_ZONE,
        Locale.getDefault());
    double millisecond = timePeriod.getFirstMillisecond();
    Range valueRange = null;
    for (int i = 0; i < timeSeriesPlot.getRangeAxisCount(); i++) {
      valueRange = Range.combine(valueRange, timeSeriesPlot.getRangeAxis(i).getRange());
    }
    if (valueRange != null) {
      XYAnnotation annotation = new XYLineAnnotation(millisecond, valueRange.getLowerBound(), millisecond,
          valueRange.getUpperBound());
      timeSeriesPlot.addAnnotation(annotation, true);
    }
  }
}

代码示例来源:origin: senbox-org/snap-desktop

RectangleAnchor.BOTTOM_RIGHT);
r2Annotation.setMaxWidth(0.48);
getPlot().addAnnotation(r2Annotation);

代码示例来源:origin: bcdev/beam

RectangleAnchor.BOTTOM_RIGHT);
r2Annotation.setMaxWidth(0.48);
getPlot().addAnnotation(r2Annotation);

代码示例来源:origin: matsim-org/matsim

yAxis.getRange().getLowerBound(),  xAxis.getRange().getUpperBound(), 
      yAxis.getRange().getUpperBound());
((XYPlot) chart2.getPlot()).addAnnotation(diagonal);
      yAxisd.getRange().getLowerBound(),  xAxisd.getRange().getUpperBound(), 
      yAxisd.getRange().getUpperBound());
((XYPlot) chart.getPlot()).addAnnotation(diagonald);

代码示例来源:origin: jfree/jfreechart-experimental

plot.addAnnotation(ta);

代码示例来源:origin: senbox-org/snap-desktop

plot.setDataset(scatterpointsDSIndex, scatterpointsDataset);
plot.addAnnotation(r2Annotation);

代码示例来源:origin: bcdev/beam

plot.setDataset(SCATTERPOINTS_DSINDEX, scatterpointsDataset);
plot.addAnnotation(r2Annotation);

相关文章

微信公众号

最新文章

更多

XYPlot类方法