Package plotter.xy

Examples of plotter.xy.LinearXYPlotLine


    XYAxis xAxis = frame.getXAxis();
    XYAxis yAxis = frame.getYAxis();
    LinearXYPlotLine[] lines = new LinearXYPlotLine[8];
    SimpleXYDataset[] datasets = new SimpleXYDataset[lines.length];
    for(int i = 0; i < lines.length; i++) {
      LinearXYPlotLine line = new LinearXYPlotLine(xAxis, yAxis, XYDimension.X);
      SimpleXYDataset d = new SimpleXYDataset(line);
      d.setMaxCapacity(1000);
      d.setXData(line.getXData());
      d.setYData(line.getYData());
      frame.addPlotLine(line);
      lines[i] = line;
      datasets[i] = d;
    }
View Full Code Here


    final LinearXYAxis xAxis = (LinearXYAxis) frame.getXAxis();
    final XYAxis yAxis = frame.getYAxis();
    xAxis.setTickMarkCalculator(new TimeTickMarkCalculator());
    xAxis.setFormat(new DateNumberFormat(new SimpleDateFormat("yyyy-MM-dd\nHH:mm:ss.SSS")));

    final LinearXYPlotLine line = new LinearXYPlotLine(xAxis, yAxis, XYDimension.X);
    line.setForeground(Color.white);
    final SimpleXYDataset d = new SimpleXYDataset(line);
    d.setMaxCapacity(1000);
    d.setXData(line.getXData());
    d.setYData(line.getYData());
    final XYMarkerLine marker = new XYMarkerLine(xAxis, 60);
    marker.setForeground(Color.yellow);
    XYPlotContents contents = frame.getContents();
    contents.add(marker);
    final XYMarkerLine marker2 = new XYMarkerLine(yAxis, .5);
View Full Code Here

    contentPane.add(plot);
    contentPane.setLayout(new BoxLayout(contentPane, BoxLayout.X_AXIS));

    new DefaultXYLayoutGenerator().generateLayout(plot);

    final LinearXYPlotLine line = new LinearXYPlotLine(xAxis, yAxis, XYDimension.X);
    line.setForeground(Color.white);
    final SimpleXYDataset d = new SimpleXYDataset(line);
    d.setMaxCapacity(10000);
    d.setXData(line.getXData());
    d.setYData(line.getYData());
    contents.add(line);
    contents.setComponentZOrder(grid, contents.getComponentCount() - 1);

    yAxis.setStart(-20);
    yAxis.setEnd(20);
View Full Code Here

    new DefaultXYLayoutGenerator().generateLayout(plot);

    contentPane.setLayout(new BoxLayout(contentPane, BoxLayout.X_AXIS));
    contentPane.add(plot);

    final LinearXYPlotLine line = new LinearXYPlotLine(xAxis, yAxis, XYDimension.X);
    line.setForeground(Color.white);
    final SimpleXYDataset d = new SimpleXYDataset(line);
    d.setMaxCapacity(10000);
    d.setXData(line.getXData());
    d.setYData(line.getYData());
    contents.add(line);
    contents.setComponentZOrder(grid, contents.getComponentCount() - 1);

    if(invertY) {
      yAxis.setStart(200);
View Full Code Here

   
    plotLabelingAlgorithm.setCanvasPanelTitle(canvasPanelTitleTest);
    Assert.assertTrue(plotLabelingAlgorithm.getCanvasPanelTitle().equals(canvasPanelTitleTest));
   
    LegendEntry testEntry = new LegendEntry(Color.white, Color.white, new Font("Arial", Font.PLAIN, 12), new AbbreviatingPlotLabelingAlgorithm());
    testEntry.setPlot(new LinearXYPlotLine(new LinearXYAxis(XYDimension.X), new LinearXYAxis(XYDimension.Y), XYDimension.X));
   
    // Empty string.
    testEntry.setBaseDisplayName("");
    Assert.assertTrue(testEntry.getBaseDisplayNameLabel().equalsIgnoreCase(""));
   
View Full Code Here

    Assert.assertFalse(testPlot.isCompressionEnabled());
   
   
    XYAxis xAxis = plotView.getXAxis();
    XYAxis yAxis = plotView.getYAxis();
    LinearXYPlotLine plot = new LinearXYPlotLine(xAxis, yAxis, XYDimension.X);
    Font font = new Font("Arial", Font.PLAIN, 10);
    LegendEntry legend = new LegendEntry(Color.white,  Color.white, font, new AbbreviatingPlotLabelingAlgorithm());
    legend.setPlot(plot);
    PlotDataSeries data = new PlotDataSeries(testPlot, "test", Color.white);
        data.setLegend(legend);   
View Full Code Here

  }
 
  @Test
  public void TestSetLinePlots() {
    PlotDataSeries data = new PlotDataSeries(mockPlot, "test", Color.white);
    LinearXYPlotLine slp = new LinearXYPlotLine(plotView.getXAxis(), plotView.getYAxis(), XYDimension.X);
    data.setLinePlot(slp);
    Assert.assertEquals(data.linePlot, slp);
    LinearXYPlotLine regressionLine = new LinearXYPlotLine(plotView.getXAxis(), plotView.getYAxis(), XYDimension.X);
    data.setRegressionLine(regressionLine);
    Assert.assertEquals(data.regressionLine, regressionLine);
    data.resetData(); // Reset should also remove regression line
    Assert.assertNull(data.getRegressionLine());
 
View Full Code Here

 
  /**
   *
   */
  private void addRegressionLine() {
    regressionLine = new LinearXYPlotLine(plot.getPlotView().getXAxis(), plot.getPlotView().getYAxis(),
        plot.getAxisOrientationSetting() == AxisOrientationSetting.X_AXIS_AS_TIME ? XYDimension.X : XYDimension.Y);
    regressionLine.setLineMode(LineMode.STRAIGHT);
    regressionLine.setForeground(color);
    regressionLine.setStroke(new BasicStroke(PlotConstants.SLOPE_LINE_WIDTH,
                BasicStroke.CAP_BUTT,
View Full Code Here

    this.rotated = rotated;
  }
 
  @Override
  public PlotLine createLine() {
    LinearXYPlotLine plotLine = new LinearXYPlotLine(plot.getXAxis(), plot.getYAxis(), rotated ? XYDimension.Y : XYDimension.X);
    XYDataset data = new CompressingXYDataset(plotLine, new DefaultCompressor());
    return new PlotterPlotLine(plotLine, data, rotated);
  }
View Full Code Here

    yAxis.setTickMarkCalculator(new TimeTickMarkCalculator());
    yAxis.setFormat(new DateNumberFormat(new SimpleDateFormat("yyyy-MM-dd\nHH:mm:ss.SSS")));
    yAxis.setPreferredSize(new Dimension(100, 50));
    xAxis.setStartMargin(100);

    final LinearXYPlotLine line = new LinearXYPlotLine(xAxis, yAxis, XYDimension.Y);
    line.setForeground(Color.white);
    final SimpleXYDataset d = new SimpleXYDataset(line);
    d.setMaxCapacity(1000);
    d.setXData(line.getXData());
    d.setYData(line.getYData());
    final XYMarkerLine marker = new XYMarkerLine(xAxis, 60);
    marker.setForeground(Color.yellow);
    XYPlotContents contents = frame.getContents();
    contents.add(marker);
    final XYMarkerLine marker2 = new XYMarkerLine(yAxis, .5);
View Full Code Here

TOP

Related Classes of plotter.xy.LinearXYPlotLine

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.