Java 类org.jfree.data.xy.XYBarDataset 实例源码

项目:parabuild-ci    文件:XYBarChartTests.java   
/**
 * Create a horizontal bar chart with sample data in the range -3 to +3.
 *
 * @return The chart.
 */
private static JFreeChart createChart() {

    // create a dataset...
    XYSeries series1 = new XYSeries("Series 1");
    series1.add(1.0, 1.0);
    series1.add(2.0, 2.0);
    series1.add(3.0, 3.0);
    IntervalXYDataset dataset = new XYBarDataset(new XYSeriesCollection(
            series1), 1.0);

    // create the chart...
    return ChartFactory.createXYBarChart(
        "XY Bar Chart",  // chart title
        "Domain", false,
        "Range",
        dataset,         // data
        PlotOrientation.VERTICAL,
        true,            // include legend
        true,            // tooltips
        true             // urls
    );

}
项目:parabuild-ci    文件:XYBarDatasetTests.java   
/**
 * Confirm that the equals method can distinguish all the required fields.
 */
public void testEquals() {
    DefaultXYDataset d1 = new DefaultXYDataset();
    double[] x1 = new double[] {1.0, 2.0, 3.0};
    double[] y1 = new double[] {4.0, 5.0, 6.0};
    double[][] data1 = new double[][] {x1, y1};
    d1.addSeries("S1", data1);
    DefaultXYDataset d2 = new DefaultXYDataset();
    double[] x2 = new double[] {1.0, 2.0, 3.0};
    double[] y2 = new double[] {4.0, 5.0, 6.0};
    double[][] data2 = new double[][] {x2, y2};
    d2.addSeries("S1", data2);

    XYBarDataset bd1 = new XYBarDataset(d1, 5.0);
    XYBarDataset bd2 = new XYBarDataset(d2, 5.0);
    assertTrue(bd1.equals(bd2));
    assertTrue(bd2.equals(bd1));
}
项目:eurocarbdb    文件:PeakListChartPanel.java   
protected void initComponents() {
setLayout(new BorderLayout());

// create chart
theDataset = new DefaultXYDataset();
theIsotopesDataset = new DefaultXYDataset();

theChart = org.jfree.chart.ChartFactory.createScatterPlot("PeakList", "m/z ratio", "Intensity", new XYBarDataset(theDataset,0.001), org.jfree.chart.plot.PlotOrientation.VERTICAL, false, false, false);
thePlot = (XYPlot)theChart.getPlot();
thePlot.setRenderer(new XYBarRenderer());

thePlot.setDataset(1, theIsotopesDataset);
thePlot.setRenderer(1,new StandardXYItemRenderer(StandardXYItemRenderer.LINES));

theChartPanel = new ChartPanel(theChart);    
theChartPanel.setDomainZoomable(false);
theChartPanel.setRangeZoomable(false);    
theChartPanel.setPopupMenu(null);
add(theChartPanel,BorderLayout.CENTER);

// create toolbar
theToolBar = createToolBar(); 
add(theToolBar,BorderLayout.SOUTH);    
}
项目:solrmeter    文件:QueryTimeHistoryPanel.java   
/**
 * Creates and initializes the chart panel.
 */
public ChartPanel createChartPanel() {
    XYBarDataset barDataset = new XYBarDataset(dataset, BAR_WIDTH);
    NumberAxis xaxis = new NumberAxis(I18n.get("statistic.queryTimeHistoryPanel.time"));
    NumberAxis yaxis = new NumberAxis(I18n.get("statistic.queryTimeHistoryPanel.averageQueryTime"));

    xaxis.setStandardTickUnits(new ChartUtils.LowerBoundedTickUnitSource(xaxis.getStandardTickUnits(), LOWER_TICK_UNIT));

    XYPlot plot = new XYPlot(barDataset, xaxis, yaxis, new XYBarRenderer());

    JFreeChart chart = new JFreeChart(I18n.get("statistic.queryTimeHistoryPanel.queryHistory"),
            null, plot, false);

    ChartPanel chartPanel = new ChartPanel(chart);

    chartPanel.setBorder(CHART_BORDER);
    chartPanel.setMinimumDrawHeight(0);
    chartPanel.setMinimumDrawWidth(0);
    chartPanel.setMaximumDrawHeight(Integer.MAX_VALUE);
    chartPanel.setMaximumDrawWidth(Integer.MAX_VALUE);

    return chartPanel;
}
项目:solrmeter    文件:HistogramChartPanel.java   
private Component createChartPanel() {
    XYBarDataset xyBarDataset = new XYBarDataset(xyDataset, BAR_WIDTH);
    NumberAxis xaxis = new NumberAxis(I18n.get("statistic.histogramChartPanel.time"));
    NumberAxis yaxis = new NumberAxis(I18n.get("statistic.histogramChartPanel.numberOfQueries"));

    xaxis.setStandardTickUnits(new ChartUtils.LowerBoundedTickUnitSource(xaxis.getStandardTickUnits(), LOWER_TICK_UNIT));

    XYPlot plot = new XYPlot(xyBarDataset, xaxis, yaxis, new XYBarRenderer());

    JFreeChart chart = new JFreeChart(I18n.get(
            "statistic.histogramChartPanel.title"),
            null, plot, false);

    ChartPanel chartPanel = new ChartPanel(chart);

    chartPanel.setBorder(CHART_BORDER);
    chartPanel.setMinimumDrawHeight(0);
    chartPanel.setMinimumDrawWidth(0);
    chartPanel.setMaximumDrawHeight(Integer.MAX_VALUE);
    chartPanel.setMaximumDrawWidth(Integer.MAX_VALUE);

    return chartPanel;
}
项目:nabs    文件:XYBarChartTests.java   
/**
 * Create a horizontal bar chart with sample data in the range -3 to +3.
 *
 * @return The chart.
 */
private static JFreeChart createChart() {

    // create a dataset...
    XYSeries series1 = new XYSeries("Series 1");
    series1.add(1.0, 1.0);
    series1.add(2.0, 2.0);
    series1.add(3.0, 3.0);
    IntervalXYDataset dataset = new XYBarDataset(new XYSeriesCollection(
            series1), 1.0);

    // create the chart...
    return ChartFactory.createXYBarChart(
        "XY Bar Chart",  // chart title
        "Domain", false,
        "Range",
        dataset,         // data
        PlotOrientation.VERTICAL,
        true,            // include legend
        true,            // tooltips
        true             // urls
    );

}
项目:nabs    文件:XYBarDatasetTests.java   
/**
 * Confirm that the equals method can distinguish all the required fields.
 */
public void testEquals() {
    DefaultXYDataset d1 = new DefaultXYDataset();
    double[] x1 = new double[] {1.0, 2.0, 3.0};
    double[] y1 = new double[] {4.0, 5.0, 6.0};
    double[][] data1 = new double[][] {x1, y1};
    d1.addSeries("S1", data1);
    DefaultXYDataset d2 = new DefaultXYDataset();
    double[] x2 = new double[] {1.0, 2.0, 3.0};
    double[] y2 = new double[] {4.0, 5.0, 6.0};
    double[][] data2 = new double[][] {x2, y2};
    d2.addSeries("S1", data2);

    XYBarDataset bd1 = new XYBarDataset(d1, 5.0);
    XYBarDataset bd2 = new XYBarDataset(d2, 5.0);
    assertTrue(bd1.equals(bd2));
    assertTrue(bd2.equals(bd1));
}
项目:astor    文件:XYBarChartTests.java   
/**
 * Create a horizontal bar chart with sample data in the range -3 to +3.
 *
 * @return The chart.
 */
private static JFreeChart createChart() {

    // create a dataset...
    XYSeries series1 = new XYSeries("Series 1");
    series1.add(1.0, 1.0);
    series1.add(2.0, 2.0);
    series1.add(3.0, 3.0);
    IntervalXYDataset dataset = new XYBarDataset(new XYSeriesCollection(
            series1), 1.0);

    // create the chart...
    return ChartFactory.createXYBarChart("XY Bar Chart", "Domain", false,
            "Range", dataset, true);

}
项目:astor    文件:XYBarDatasetTests.java   
/**
 * Confirm that the equals method can distinguish all the required fields.
 */
public void testEquals() {
    DefaultXYDataset d1 = new DefaultXYDataset();
    double[] x1 = new double[] {1.0, 2.0, 3.0};
    double[] y1 = new double[] {4.0, 5.0, 6.0};
    double[][] data1 = new double[][] {x1, y1};
    d1.addSeries("S1", data1);
    DefaultXYDataset d2 = new DefaultXYDataset();
    double[] x2 = new double[] {1.0, 2.0, 3.0};
    double[] y2 = new double[] {4.0, 5.0, 6.0};
    double[][] data2 = new double[][] {x2, y2};
    d2.addSeries("S1", data2);

    XYBarDataset bd1 = new XYBarDataset(d1, 5.0);
    XYBarDataset bd2 = new XYBarDataset(d2, 5.0);
    assertTrue(bd1.equals(bd2));
    assertTrue(bd2.equals(bd1));
}
项目:ccu-historian    文件:XYBarChartTest.java   
/**
 * Create a horizontal bar chart with sample data in the range -3 to +3.
 *
 * @return The chart.
 */
private static JFreeChart createChart() {
    XYSeries series1 = new XYSeries("Series 1");
    series1.add(1.0, 1.0);
    series1.add(2.0, 2.0);
    series1.add(3.0, 3.0);
    IntervalXYDataset dataset = new XYBarDataset(new XYSeriesCollection(
            series1), 1.0);
    return ChartFactory.createXYBarChart("XY Bar Chart", "Domain", false,
            "Range", dataset);

}
项目:ccu-historian    文件:XYBarRendererTest.java   
/**
 * A check for the datasetIndex and seriesIndex fields in the LegendItem
 * returned by the getLegendItem() method.
 */
@Test
public void testGetLegendItemSeriesIndex() {
    XYSeriesCollection d1 = new XYSeriesCollection();
    XYSeries s1 = new XYSeries("S1");
    s1.add(1.0, 1.1);
    XYSeries s2 = new XYSeries("S2");
    s2.add(1.0, 1.1);
    d1.addSeries(s1);
    d1.addSeries(s2);

    XYSeriesCollection d2 = new XYSeriesCollection();
    XYSeries s3 = new XYSeries("S3");
    s3.add(1.0, 1.1);
    XYSeries s4 = new XYSeries("S4");
    s4.add(1.0, 1.1);
    XYSeries s5 = new XYSeries("S5");
    s5.add(1.0, 1.1);
    d2.addSeries(s3);
    d2.addSeries(s4);
    d2.addSeries(s5);

    XYBarRenderer r = new XYBarRenderer();
    XYPlot plot = new XYPlot(new XYBarDataset(d1, 1.0), new NumberAxis("x"),
            new NumberAxis("y"), r);
    plot.setDataset(1, new XYBarDataset(d2, 2.0));
    /*JFreeChart chart =*/ new JFreeChart(plot);
    LegendItem li = r.getLegendItem(1, 2);
    assertEquals("S5", li.getLabel());
    assertEquals(1, li.getDatasetIndex());
    assertEquals(2, li.getSeriesIndex());
}
项目:jfreechart    文件:XYBarChartTest.java   
/**
 * Create a horizontal bar chart with sample data in the range -3 to +3.
 *
 * @return The chart.
 */
private static JFreeChart createChart() {
    XYSeries series1 = new XYSeries("Series 1");
    series1.add(1.0, 1.0);
    series1.add(2.0, 2.0);
    series1.add(3.0, 3.0);
    IntervalXYDataset dataset = new XYBarDataset(new XYSeriesCollection(
            series1), 1.0);
    return ChartFactory.createXYBarChart("XY Bar Chart", "Domain", false,
            "Range", dataset);

}
项目:jfreechart    文件:XYBarRendererTest.java   
/**
 * A check for the datasetIndex and seriesIndex fields in the LegendItem
 * returned by the getLegendItem() method.
 */
@Test
public void testGetLegendItemSeriesIndex() {
    XYSeriesCollection d1 = new XYSeriesCollection();
    XYSeries s1 = new XYSeries("S1");
    s1.add(1.0, 1.1);
    XYSeries s2 = new XYSeries("S2");
    s2.add(1.0, 1.1);
    d1.addSeries(s1);
    d1.addSeries(s2);

    XYSeriesCollection d2 = new XYSeriesCollection();
    XYSeries s3 = new XYSeries("S3");
    s3.add(1.0, 1.1);
    XYSeries s4 = new XYSeries("S4");
    s4.add(1.0, 1.1);
    XYSeries s5 = new XYSeries("S5");
    s5.add(1.0, 1.1);
    d2.addSeries(s3);
    d2.addSeries(s4);
    d2.addSeries(s5);

    XYBarRenderer r = new XYBarRenderer();
    XYPlot plot = new XYPlot(new XYBarDataset(d1, 1.0), new NumberAxis("x"),
            new NumberAxis("y"), r);
    plot.setDataset(1, new XYBarDataset(d2, 2.0));
    /*JFreeChart chart =*/ new JFreeChart(plot);
    LegendItem li = r.getLegendItem(1, 2);
    assertEquals("S5", li.getLabel());
    assertEquals(1, li.getDatasetIndex());
    assertEquals(2, li.getSeriesIndex());
}
项目:aya-lang    文件:XYBarChartTest.java   
/**
 * Create a horizontal bar chart with sample data in the range -3 to +3.
 *
 * @return The chart.
 */
private static JFreeChart createChart() {
    XYSeries series1 = new XYSeries("Series 1");
    series1.add(1.0, 1.0);
    series1.add(2.0, 2.0);
    series1.add(3.0, 3.0);
    IntervalXYDataset dataset = new XYBarDataset(new XYSeriesCollection(
            series1), 1.0);
    return ChartFactory.createXYBarChart("XY Bar Chart", "Domain", false,
            "Range", dataset);

}
项目:aya-lang    文件:XYBarRendererTest.java   
/**
 * A check for the datasetIndex and seriesIndex fields in the LegendItem
 * returned by the getLegendItem() method.
 */
@Test
public void testGetLegendItemSeriesIndex() {
    XYSeriesCollection d1 = new XYSeriesCollection();
    XYSeries s1 = new XYSeries("S1");
    s1.add(1.0, 1.1);
    XYSeries s2 = new XYSeries("S2");
    s2.add(1.0, 1.1);
    d1.addSeries(s1);
    d1.addSeries(s2);

    XYSeriesCollection d2 = new XYSeriesCollection();
    XYSeries s3 = new XYSeries("S3");
    s3.add(1.0, 1.1);
    XYSeries s4 = new XYSeries("S4");
    s4.add(1.0, 1.1);
    XYSeries s5 = new XYSeries("S5");
    s5.add(1.0, 1.1);
    d2.addSeries(s3);
    d2.addSeries(s4);
    d2.addSeries(s5);

    XYBarRenderer r = new XYBarRenderer();
    XYPlot plot = new XYPlot(new XYBarDataset(d1, 1.0), new NumberAxis("x"),
            new NumberAxis("y"), r);
    plot.setDataset(1, new XYBarDataset(d2, 2.0));
    /*JFreeChart chart =*/ new JFreeChart(plot);
    LegendItem li = r.getLegendItem(1, 2);
    assertEquals("S5", li.getLabel());
    assertEquals(1, li.getDatasetIndex());
    assertEquals(2, li.getSeriesIndex());
}
项目:groovychart    文件:XYBarDatasetBuilder.java   
public void processNode(Object name, Map map, Object value) throws Exception {
    if(value != null && value instanceof XYBarDataset) {
        this.xyDataset = (XYBarDataset)value;
    }else {
        // TODO
    }         
}
项目:graylog-plugin-aggregates    文件:ChartFactory.java   
public static JFreeChart generateTimeSeriesChart(String title, List<HistoryAggregateItem> history, String timespan, Calendar cal) throws ParseException {

    TimeSeries series = initializeSeries(timespan, cal, history);

    TimeSeriesCollection dataset = new TimeSeriesCollection();  
    dataset.addSeries(series);
    IntervalXYDataset idataset = new XYBarDataset(dataset, 1);


    JFreeChart chart = org.jfree.chart.ChartFactory.createXYBarChart(  
            title, // Title  
            "Date/time",         // X-axis Label
            true,
            "Hits",       // Y-axis Label  
            idataset,        // Dataset
            PlotOrientation.VERTICAL,  
            true,          // Show legend  
            true,          // Use tooltips  
            false          // Generate URLs  
            );

    chart.setBackgroundPaint(Color.WHITE);
    chart.setBorderPaint(Color.BLACK);

    XYPlot plot = (XYPlot)chart.getPlot();
    plot.setBackgroundPaint(Color.LIGHT_GRAY);

    plot.getRenderer().setSeriesPaint(0, Color.BLUE);
    plot.setDomainGridlinePaint(Color.GRAY);
       plot.setRangeGridlinePaint(Color.GRAY);
    chart.removeLegend();

    return chart;
}
项目:eurocarbdb    文件:AnnotationReportCanvas.java   
private void updateChart() {
String x_label = "m/z ratio";
String y_label = (theDocument.isShowRelativeIntensities()) ?"Intensity %" :"Intensity";
theDataset = new DefaultXYDataset();

if( theDocument.getPeakData()!=null ) {
    theChart = org.jfree.chart.ChartFactory.createScatterPlot(null, x_label, y_label, theDataset, org.jfree.chart.plot.PlotOrientation.VERTICAL, false, false, false);
    thePlot = (XYPlot)theChart.getPlot();    
    thePlot.setRenderer(new StandardXYItemRenderer(StandardXYItemRenderer.LINES));
}
else {
    theChart = org.jfree.chart.ChartFactory.createScatterPlot(null, x_label, y_label, new XYBarDataset(theDataset,0.001), org.jfree.chart.plot.PlotOrientation.VERTICAL, false, false, false);
    thePlot = (XYPlot)theChart.getPlot();    
    thePlot.setRenderer(new XYBarRenderer());
}


if( theDocument.isShowRelativeIntensities() && theOptions.SHOW_MAX_INTENSITY ) {
    // set second axis
    ValueAxis second_axis = new NumberAxis("");
    thePlot.setRangeAxis(1, second_axis);

    // set dataset
    maxIntensityDataset = new DefaultXYDataset();       
    thePlot.setDataset(1, maxIntensityDataset);
    thePlot.mapDatasetToRangeAxis(1, 1);

    // set invisible renderer
    StandardXYItemRenderer r = new StandardXYItemRenderer(StandardXYItemRenderer.SHAPES);
    r.setBaseShapesVisible(false);
    thePlot.setRenderer(1,r);        
}        

theChart.setBackgroundPaint(Color.white);
theChart.setBorderVisible(false);
thePlot.getRenderer().setPaint(theOptions.SPECTRUM_COLOR);
thePlot.setOutlinePaint(null);
thePlot.setDomainGridlinesVisible(false);
thePlot.setRangeGridlinesVisible(false);
}
项目:ECG-Viewer    文件:XYBarChartTest.java   
/**
 * Create a horizontal bar chart with sample data in the range -3 to +3.
 *
 * @return The chart.
 */
private static JFreeChart createChart() {
    XYSeries series1 = new XYSeries("Series 1");
    series1.add(1.0, 1.0);
    series1.add(2.0, 2.0);
    series1.add(3.0, 3.0);
    IntervalXYDataset dataset = new XYBarDataset(new XYSeriesCollection(
            series1), 1.0);
    return ChartFactory.createXYBarChart("XY Bar Chart", "Domain", false,
            "Range", dataset);

}
项目:ECG-Viewer    文件:XYBarRendererTest.java   
/**
 * A check for the datasetIndex and seriesIndex fields in the LegendItem
 * returned by the getLegendItem() method.
 */
@Test
public void testGetLegendItemSeriesIndex() {
    XYSeriesCollection d1 = new XYSeriesCollection();
    XYSeries s1 = new XYSeries("S1");
    s1.add(1.0, 1.1);
    XYSeries s2 = new XYSeries("S2");
    s2.add(1.0, 1.1);
    d1.addSeries(s1);
    d1.addSeries(s2);

    XYSeriesCollection d2 = new XYSeriesCollection();
    XYSeries s3 = new XYSeries("S3");
    s3.add(1.0, 1.1);
    XYSeries s4 = new XYSeries("S4");
    s4.add(1.0, 1.1);
    XYSeries s5 = new XYSeries("S5");
    s5.add(1.0, 1.1);
    d2.addSeries(s3);
    d2.addSeries(s4);
    d2.addSeries(s5);

    XYBarRenderer r = new XYBarRenderer();
    XYPlot plot = new XYPlot(new XYBarDataset(d1, 1.0), new NumberAxis("x"),
            new NumberAxis("y"), r);
    plot.setDataset(1, new XYBarDataset(d2, 2.0));
    /*JFreeChart chart =*/ new JFreeChart(plot);
    LegendItem li = r.getLegendItem(1, 2);
    assertEquals("S5", li.getLabel());
    assertEquals(1, li.getDatasetIndex());
    assertEquals(2, li.getSeriesIndex());
}
项目:astor    文件:XYBarRendererTests.java   
/**
 * A check for the datasetIndex and seriesIndex fields in the LegendItem
 * returned by the getLegendItem() method.
 */
public void testGetLegendItemSeriesIndex() {
    XYSeriesCollection d1 = new XYSeriesCollection();
    XYSeries s1 = new XYSeries("S1");
    s1.add(1.0, 1.1);
    XYSeries s2 = new XYSeries("S2");
    s2.add(1.0, 1.1);
    d1.addSeries(s1);
    d1.addSeries(s2);

    XYSeriesCollection d2 = new XYSeriesCollection();
    XYSeries s3 = new XYSeries("S3");
    s3.add(1.0, 1.1);
    XYSeries s4 = new XYSeries("S4");
    s4.add(1.0, 1.1);
    XYSeries s5 = new XYSeries("S5");
    s5.add(1.0, 1.1);
    d2.addSeries(s3);
    d2.addSeries(s4);
    d2.addSeries(s5);

    XYBarRenderer r = new XYBarRenderer();
    XYPlot plot = new XYPlot(new XYBarDataset(d1, 1.0), new NumberAxis("x"),
            new NumberAxis("y"), r);
    plot.setDataset(1, new XYBarDataset(d2, 2.0));
    /*JFreeChart chart =*/ new JFreeChart(plot);
    LegendItem li = r.getLegendItem(1, 2);
    assertEquals("S5", li.getLabel());
    assertEquals(1, li.getDatasetIndex());
    assertEquals(2, li.getSeriesIndex());
}
项目:astor    文件:XYBarDatasetTests.java   
/**
 * Verify that this class implements {@link PublicCloneable}.
 */
public void testPublicCloneable() {
    DefaultXYDataset d1 = new DefaultXYDataset();
    double[] x1 = new double[] {1.0, 2.0, 3.0};
    double[] y1 = new double[] {4.0, 5.0, 6.0};
    double[][] data1 = new double[][] {x1, y1};
    d1.addSeries("S1", data1);
    XYBarDataset bd1 = new XYBarDataset(d1, 5.0);
    assertTrue(bd1 instanceof PublicCloneable);
}
项目:group-five    文件:XYBarChartTest.java   
/**
 * Create a horizontal bar chart with sample data in the range -3 to +3.
 *
 * @return The chart.
 */
private static JFreeChart createChart() {
    XYSeries series1 = new XYSeries("Series 1");
    series1.add(1.0, 1.0);
    series1.add(2.0, 2.0);
    series1.add(3.0, 3.0);
    IntervalXYDataset dataset = new XYBarDataset(new XYSeriesCollection(
            series1), 1.0);
    return ChartFactory.createXYBarChart("XY Bar Chart", "Domain", false,
            "Range", dataset);

}
项目:group-five    文件:XYBarRendererTest.java   
/**
 * A check for the datasetIndex and seriesIndex fields in the LegendItem
 * returned by the getLegendItem() method.
 */
@Test
public void testGetLegendItemSeriesIndex() {
    XYSeriesCollection d1 = new XYSeriesCollection();
    XYSeries s1 = new XYSeries("S1");
    s1.add(1.0, 1.1);
    XYSeries s2 = new XYSeries("S2");
    s2.add(1.0, 1.1);
    d1.addSeries(s1);
    d1.addSeries(s2);

    XYSeriesCollection d2 = new XYSeriesCollection();
    XYSeries s3 = new XYSeries("S3");
    s3.add(1.0, 1.1);
    XYSeries s4 = new XYSeries("S4");
    s4.add(1.0, 1.1);
    XYSeries s5 = new XYSeries("S5");
    s5.add(1.0, 1.1);
    d2.addSeries(s3);
    d2.addSeries(s4);
    d2.addSeries(s5);

    XYBarRenderer r = new XYBarRenderer();
    XYPlot plot = new XYPlot(new XYBarDataset(d1, 1.0), new NumberAxis("x"),
            new NumberAxis("y"), r);
    plot.setDataset(1, new XYBarDataset(d2, 2.0));
    /*JFreeChart chart =*/ new JFreeChart(plot);
    LegendItem li = r.getLegendItem(1, 2);
    assertEquals("S5", li.getLabel());
    assertEquals(1, li.getDatasetIndex());
    assertEquals(2, li.getSeriesIndex());
}
项目:buffer_bci    文件:XYBarChartTest.java   
/**
 * Create a horizontal bar chart with sample data in the range -3 to +3.
 *
 * @return The chart.
 */
private static JFreeChart createChart() {
    XYSeries series1 = new XYSeries("Series 1");
    series1.add(1.0, 1.0);
    series1.add(2.0, 2.0);
    series1.add(3.0, 3.0);
    IntervalXYDataset dataset = new XYBarDataset(new XYSeriesCollection(
            series1), 1.0);
    return ChartFactory.createXYBarChart("XY Bar Chart", "Domain", false,
            "Range", dataset);

}
项目:buffer_bci    文件:XYBarRendererTest.java   
/**
 * A check for the datasetIndex and seriesIndex fields in the LegendItem
 * returned by the getLegendItem() method.
 */
@Test
public void testGetLegendItemSeriesIndex() {
    XYSeriesCollection d1 = new XYSeriesCollection();
    XYSeries s1 = new XYSeries("S1");
    s1.add(1.0, 1.1);
    XYSeries s2 = new XYSeries("S2");
    s2.add(1.0, 1.1);
    d1.addSeries(s1);
    d1.addSeries(s2);

    XYSeriesCollection d2 = new XYSeriesCollection();
    XYSeries s3 = new XYSeries("S3");
    s3.add(1.0, 1.1);
    XYSeries s4 = new XYSeries("S4");
    s4.add(1.0, 1.1);
    XYSeries s5 = new XYSeries("S5");
    s5.add(1.0, 1.1);
    d2.addSeries(s3);
    d2.addSeries(s4);
    d2.addSeries(s5);

    XYBarRenderer r = new XYBarRenderer();
    XYPlot plot = new XYPlot(new XYBarDataset(d1, 1.0), new NumberAxis("x"),
            new NumberAxis("y"), r);
    plot.setDataset(1, new XYBarDataset(d2, 2.0));
    /*JFreeChart chart =*/ new JFreeChart(plot);
    LegendItem li = r.getLegendItem(1, 2);
    assertEquals("S5", li.getLabel());
    assertEquals(1, li.getDatasetIndex());
    assertEquals(2, li.getSeriesIndex());
}
项目:proyecto-teoria-control-utn-frro    文件:XYBarChartTest.java   
/**
 * Create a horizontal bar chart with sample data in the range -3 to +3.
 *
 * @return The chart.
 */
private static JFreeChart createChart() {
    XYSeries series1 = new XYSeries("Series 1");
    series1.add(1.0, 1.0);
    series1.add(2.0, 2.0);
    series1.add(3.0, 3.0);
    IntervalXYDataset dataset = new XYBarDataset(new XYSeriesCollection(
            series1), 1.0);
    return ChartFactory.createXYBarChart("XY Bar Chart", "Domain", false,
            "Range", dataset);

}
项目:proyecto-teoria-control-utn-frro    文件:XYBarRendererTest.java   
/**
 * A check for the datasetIndex and seriesIndex fields in the LegendItem
 * returned by the getLegendItem() method.
 */
@Test
public void testGetLegendItemSeriesIndex() {
    XYSeriesCollection d1 = new XYSeriesCollection();
    XYSeries s1 = new XYSeries("S1");
    s1.add(1.0, 1.1);
    XYSeries s2 = new XYSeries("S2");
    s2.add(1.0, 1.1);
    d1.addSeries(s1);
    d1.addSeries(s2);

    XYSeriesCollection d2 = new XYSeriesCollection();
    XYSeries s3 = new XYSeries("S3");
    s3.add(1.0, 1.1);
    XYSeries s4 = new XYSeries("S4");
    s4.add(1.0, 1.1);
    XYSeries s5 = new XYSeries("S5");
    s5.add(1.0, 1.1);
    d2.addSeries(s3);
    d2.addSeries(s4);
    d2.addSeries(s5);

    XYBarRenderer r = new XYBarRenderer();
    XYPlot plot = new XYPlot(new XYBarDataset(d1, 1.0), new NumberAxis("x"),
            new NumberAxis("y"), r);
    plot.setDataset(1, new XYBarDataset(d2, 2.0));
    /*JFreeChart chart =*/ new JFreeChart(plot);
    LegendItem li = r.getLegendItem(1, 2);
    assertEquals("S5", li.getLabel());
    assertEquals(1, li.getDatasetIndex());
    assertEquals(2, li.getSeriesIndex());
}
项目:Memetic-Algorithm-for-TSP    文件:XYBarChartTest.java   
/**
 * Create a horizontal bar chart with sample data in the range -3 to +3.
 *
 * @return The chart.
 */
private static JFreeChart createChart() {
    XYSeries series1 = new XYSeries("Series 1");
    series1.add(1.0, 1.0);
    series1.add(2.0, 2.0);
    series1.add(3.0, 3.0);
    IntervalXYDataset dataset = new XYBarDataset(new XYSeriesCollection(
            series1), 1.0);
    return ChartFactory.createXYBarChart("XY Bar Chart", "Domain", false,
            "Range", dataset);

}
项目:Memetic-Algorithm-for-TSP    文件:XYBarRendererTest.java   
/**
 * A check for the datasetIndex and seriesIndex fields in the LegendItem
 * returned by the getLegendItem() method.
 */
@Test
public void testGetLegendItemSeriesIndex() {
    XYSeriesCollection d1 = new XYSeriesCollection();
    XYSeries s1 = new XYSeries("S1");
    s1.add(1.0, 1.1);
    XYSeries s2 = new XYSeries("S2");
    s2.add(1.0, 1.1);
    d1.addSeries(s1);
    d1.addSeries(s2);

    XYSeriesCollection d2 = new XYSeriesCollection();
    XYSeries s3 = new XYSeries("S3");
    s3.add(1.0, 1.1);
    XYSeries s4 = new XYSeries("S4");
    s4.add(1.0, 1.1);
    XYSeries s5 = new XYSeries("S5");
    s5.add(1.0, 1.1);
    d2.addSeries(s3);
    d2.addSeries(s4);
    d2.addSeries(s5);

    XYBarRenderer r = new XYBarRenderer();
    XYPlot plot = new XYPlot(new XYBarDataset(d1, 1.0), new NumberAxis("x"),
            new NumberAxis("y"), r);
    plot.setDataset(1, new XYBarDataset(d2, 2.0));
    /*JFreeChart chart =*/ new JFreeChart(plot);
    LegendItem li = r.getLegendItem(1, 2);
    assertEquals("S5", li.getLabel());
    assertEquals(1, li.getDatasetIndex());
    assertEquals(2, li.getSeriesIndex());
}
项目:groovychart    文件:XYBarDatasetBuilder.java   
/**
 * Getter for property xyDataset.
 * @return Value of property xyDataset.
 */
public XYBarDataset getXyDataset() {
    return this.xyDataset;
}
项目:groovychart    文件:XYBarDatasetBuilder.java   
/**
 * Setter for property xyDataset.
 * @param xyDataset New value of property xyDataset.
 */
public void setXyDataset(XYBarDataset xyDataset) {
    this.xyDataset = xyDataset;
}