/** * Creates a scatter plot with default settings. The chart object * returned by this method uses an {@link XYPlot} instance as the plot, * with a {@link NumberAxis} for the domain axis, a {@link NumberAxis} * as the range axis, and an {@link XYLineAndShapeRenderer} as the * renderer. * * @param title the chart title ({@code null} permitted). * @param xAxisLabel a label for the X-axis ({@code null} permitted). * @param yAxisLabel a label for the Y-axis ({@code null} permitted). * @param dataset the dataset for the chart ({@code null} permitted). * * @return A scatter plot. * * @since 1.0.16 */ public static JFreeChart createScatterPlot(String title, String xAxisLabel, String yAxisLabel, XYDataset dataset) { return createScatterPlot(title, xAxisLabel, yAxisLabel, dataset, PlotOrientation.VERTICAL, true, true, false); }
public static JFreeChart createScatterPlot(String title, String xAxisLabel, String yAxisLabel, XYDataset dataset, PlotOrientation orientation, boolean legend, boolean tooltips, boolean urls) { JFreeChart chart = ChartFactory.createScatterPlot(title, xAxisLabel, yAxisLabel, dataset, orientation, legend, tooltips, urls); setScatterPlotDefaults(chart); return chart; }
private JFreeChart createScatterPlot(PixExOp.VariableCombination variableCombination, XYSeries dataset, long productId) { final XYSeriesCollection data = new XYSeriesCollection(); data.addSeries(dataset); String scatterPlotName = String.format("Scatter plot of '%s' and '%s' for product '%s'", variableCombination.originalVariableName, variableCombination.productVariableName, productNames.get(productId)); return ChartFactory.createScatterPlot(scatterPlotName, variableCombination.originalVariableName, variableCombination.productVariableName, data, PlotOrientation.VERTICAL, false, false, false); }
public ParetoFront( List<TupleTwo<Double, Double>> data, String chartTitle ) { super(chartTitle); JFreeChart lineChart = ChartFactory.createScatterPlot( chartTitle, "objective-1","objective-2", createDataset(data)); ChartPanel chartPanel = new ChartPanel( lineChart ); chartPanel.setPreferredSize( new java.awt.Dimension( 560 , 367 ) ); setContentPane( chartPanel ); this.pack( ); }
.createScatterPlot("title", "Logic", "Hard", dataset, PlotOrientation.HORIZONTAL, false, false, false);
public static CurveGraphPanel getInstance() { if (INSTANCE == null) { eccSeries = new XYSeries("ecc", false); XYSeriesCollection dataset = new XYSeriesCollection(); dataset.addSeries(eccSeries); JFreeChart chart = ChartFactory.createScatterPlot(null, null, null, dataset, PlotOrientation.VERTICAL, false, true, false); INSTANCE = new CurveGraphPanel(chart); XYItemRenderer renderer = chart.getXYPlot().getRenderer(); renderer.setSeriesPaint(2, Color.BLACK); } return INSTANCE; }
chart = ChartFactory.createScatterPlot(plotTitle, xAxis, yAxis, collection, orientation, show, toolTips, urls); break;
JFreeChart jfc = ChartFactory.createScatterPlot( "Cluster Analysis", firstAttributeName, secondAttributeName, dataset, PlotOrientation.VERTICAL, true, true, false );
public JFreeChart createChart(Chart chart) { ChartModel model = (ChartModel) chart.getModel(); if (!(model instanceof XYModel)) { throw new UiException("model must be a org.zkoss.zul.XYModel"); } return ChartFactory.createScatterPlot( chart.getTitle(), chart.getXAxis(), chart.getYAxis(), XYModelToXYDataset((XYModel)model), getOrientation(chart.getOrient()), chart.isShowLegend(), chart.isShowTooltiptext(), true); } }
private JFreeChart createChart(final String title, final String categoryAxisLabel, final String valueAxisLabel, final XYSeriesCollection dataset) { JFreeChart c = ChartFactory.createScatterPlot(title, categoryAxisLabel, valueAxisLabel, dataset, PlotOrientation.VERTICAL, true, // legend? false, // tooltips? false // URLs? ); if (this.isLogarithmicAxis) { XYPlot p = (XYPlot) c.getPlot(); LogarithmicAxis axis_x = new LogarithmicAxis(this.xAxisLabel); LogarithmicAxis axis_y = new LogarithmicAxis(this.yAxisLabel); axis_x.setAllowNegativesFlag(false); axis_y.setAllowNegativesFlag(false); p.setDomainAxis(axis_x); p.setRangeAxis(axis_y); } return c; }
public JFreeChart createChart(PlotParameters params) throws PlotException { JFreeChart chart; XYSeriesCollection dataset = new XYSeriesCollection(); dataset.addSeries(getXYSeries()); switch (params.type) { case LINE: chart = ChartFactory.createXYLineChart(params.title, params.xAxisLabel, params.yAxisLabel, dataset, params.orientation, params.showLegend, false, false); break; case BAR: chart = ChartFactory.createXYBarChart(params.title, params.xAxisLabel, false, params.yAxisLabel, dataset, params.orientation, params.showLegend, false, false); break; case SCATTER: chart = ChartFactory.createScatterPlot(params.title, params.xAxisLabel, params.yAxisLabel, dataset, params.orientation, params.showLegend, false, false); break; default: throw new PlotException("unsupported plot type"); } return chart; } }
public JFreeChart createChart(PlotParameters params) throws PlotException { JFreeChart chart; XYSeriesCollection dataset = new XYSeriesCollection(); dataset.addSeries(getXYSeries()); switch (params.type) { case LINE: chart = ChartFactory.createXYLineChart(params.title, params.xAxisLabel, params.yAxisLabel, dataset, params.orientation, params.showLegend, false, false); break; case BAR: chart = ChartFactory.createXYBarChart(params.title, params.xAxisLabel, false, params.yAxisLabel, dataset, params.orientation, params.showLegend, false, false); break; case SCATTER: chart = ChartFactory.createScatterPlot(params.title, params.xAxisLabel, params.yAxisLabel, dataset, params.orientation, params.showLegend, false, false); break; default: throw new PlotException("unsupported plot type"); } return chart; } }
public JFreeChart createChart(PlotParameters params) throws PlotException { JFreeChart chart; XYSeriesCollection dataset = new XYSeriesCollection(); dataset.addSeries(vertexConnectivity.getXYSeries()); dataset.addSeries(edgeConnectivity.getXYSeries()); switch (params.type) { case LINE: chart = ChartFactory.createXYLineChart(params.title, params.xAxisLabel, params.yAxisLabel, dataset, params.orientation, params.showLegend, false, false); break; case BAR: chart = ChartFactory.createXYBarChart(params.title, params.xAxisLabel, false, params.yAxisLabel, dataset, params.orientation, params.showLegend, false, false); break; case SCATTER: chart = ChartFactory.createScatterPlot(params.title, params.xAxisLabel, params.yAxisLabel, dataset, params.orientation, params.showLegend, false, false); break; default: throw new PlotException("unsupported plot type"); } return chart; }
private ChartInfo createPlot(String labelX, String labelY, double maxX, double maxY) { ChartInfo ret = new ChartInfo(); JFreeChart chart = ChartFactory.createScatterPlot( null, labelX, labelY, ret.dataset, PlotOrientation.VERTICAL, false,false,false); NumberAxis domainAxis = (NumberAxis) chart.getXYPlot().getDomainAxis(); domainAxis.setRange(0,maxX); NumberAxis rangeAxis = (NumberAxis) chart.getXYPlot().getRangeAxis(); rangeAxis.setRange(0,maxY); ChartPanel panel = new ChartPanel(chart); panel.setPreferredSize(new Dimension(250, 250)); panel.setMinimumSize(getPreferredSize()); panel.setMaximumSize(getPreferredSize()); ret.chart = chart; ret.panel = panel; return ret; }
public JFreeChart createChart(PlotParameters params) throws PlotException { JFreeChart chart; XYSeriesCollection dataset = new XYSeriesCollection(); dataset.addSeries(vertexConnectivity.getXYSeries()); dataset.addSeries(edgeConnectivity.getXYSeries()); switch (params.type) { case LINE: chart = ChartFactory.createXYLineChart(params.title, params.xAxisLabel, params.yAxisLabel, dataset, params.orientation, params.showLegend, false, false); break; case BAR: chart = ChartFactory.createXYBarChart(params.title, params.xAxisLabel, false, params.yAxisLabel, dataset, params.orientation, params.showLegend, false, false); break; case SCATTER: chart = ChartFactory.createScatterPlot(params.title, params.xAxisLabel, params.yAxisLabel, dataset, params.orientation, params.showLegend, false, false); break; default: throw new PlotException("unsupported plot type"); } return chart; }
protected void init (String title, String XLabel, String YLabel) { // create the chart... chart = ChartFactory.createScatterPlot ( title, // chart title XLabel, // x axis label YLabel, // y axis label dataset.getSeriesCollection(), // data PlotOrientation.VERTICAL, true, // include legend true, // tooltips false // urls ); ((XYPlot)chart.getPlot()).setRenderer(dataset.getRenderer()); // Initialize axis variables initAxis(); int nb = getSeriesCollection().getSeriesCollection().getSeriesCount(); for (int i = 0 ; i < nb ; i++) { getSeriesCollection().setDashPattern(i, "only marks"); getSeriesCollection().setMarksType(i, "+"); } }
regressionDataset = new XYIntervalSeriesCollection(); r2Annotation = new XYTitleAnnotation(0, 0, new TextTitle("")); chart = ChartFactory.createScatterPlot(CHART_TITLE, "", "", scatterpointsDataset, PlotOrientation.VERTICAL, true, true, false); chart.getXYPlot().setDatasetRenderingOrder(DatasetRenderingOrder.FORWARD);
regressionDataset = new XYIntervalSeriesCollection(); r2Annotation = new XYTitleAnnotation(0, 0, new TextTitle("")); chart = ChartFactory.createScatterPlot(CHART_TITLE, "", "", scatterpointsDataset, PlotOrientation.VERTICAL, true, true, false); chart.getXYPlot().setDatasetRenderingOrder(DatasetRenderingOrder.FORWARD);
protected JFreeChart createScatterChart() throws JRException JFreeChart jfreeChart = ChartFactory.createScatterPlot( (String)evaluateExpression(getChart().getTitleExpression()), (String)evaluateExpression(((JRScatterPlot)getPlot()).getXAxisLabelExpression()),
ScatterSettings aScatter) { JFreeChart chart = ChartFactory.createScatterPlot(null, // title