當前位置: 首頁>>代碼示例>>Java>>正文


Java StandardXYItemRenderer.LINES屬性代碼示例

本文整理匯總了Java中org.jfree.chart.renderer.xy.StandardXYItemRenderer.LINES屬性的典型用法代碼示例。如果您正苦於以下問題:Java StandardXYItemRenderer.LINES屬性的具體用法?Java StandardXYItemRenderer.LINES怎麽用?Java StandardXYItemRenderer.LINES使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在org.jfree.chart.renderer.xy.StandardXYItemRenderer的用法示例。


在下文中一共展示了StandardXYItemRenderer.LINES屬性的8個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: createXYLineChart

/**
 * Creates a line chart (based on an {@link XYDataset}) with default settings.
 *
 * @param title  the chart title (<code>null</code> permitted).
 * @param xAxisLabel  a label for the X-axis (<code>null</code> permitted).
 * @param yAxisLabel  a label for the Y-axis (<code>null</code> permitted).
 * @param dataset  the dataset for the chart (<code>null</code> permitted).
 * @param orientation  the plot orientation (horizontal or vertical) (<code>null</code> NOT
 *                     permitted).
 * @param legend  a flag specifying whether or not a legend is required.
 * @param tooltips  configure chart to generate tool tips?
 * @param urls  configure chart to generate URLs?
 *
 * @return The chart.
 */
public static JFreeChart createXYLineChart(String title,
                                           String xAxisLabel,
                                           String yAxisLabel,
                                           XYDataset dataset,
                                           PlotOrientation orientation,
                                           boolean legend,
                                           boolean tooltips,
                                           boolean urls) {

    if (orientation == null) {
        throw new IllegalArgumentException("Null 'orientation' argument.");
    }
    NumberAxis xAxis = new NumberAxis(xAxisLabel);
    xAxis.setAutoRangeIncludesZero(false);
    NumberAxis yAxis = new NumberAxis(yAxisLabel);
    XYItemRenderer renderer = new StandardXYItemRenderer(StandardXYItemRenderer.LINES);
    XYPlot plot = new XYPlot(dataset, xAxis, yAxis, renderer);
    plot.setOrientation(orientation);
    if (tooltips) {
        renderer.setToolTipGenerator(new StandardXYToolTipGenerator());
    }
    if (urls) {
        renderer.setURLGenerator(new StandardXYURLGenerator());
    }

    JFreeChart chart = new JFreeChart(title, JFreeChart.DEFAULT_TITLE_FONT, plot, legend);

    return chart;

}
 
開發者ID:parabuild-ci,項目名稱:parabuild-ci,代碼行數:45,代碼來源:ChartFactory.java

示例2: createChart

@Override
protected JFreeChart createChart(CCMovieList movielist, StatisticsTypeFilter source) {
	DateAxis dateAxis = new DateAxis(""); //$NON-NLS-1$
    dateAxis.setDateFormatOverride(new SimpleDateFormat("dd.MM.yyyy")); //$NON-NLS-1$

    NumberAxis valueAxis = new NumberAxis(""); //$NON-NLS-1$
    valueAxis.setNumberFormatOverride(new ByteFormat());

    StandardXYItemRenderer renderer = new StandardXYItemRenderer(StandardXYItemRenderer.LINES, null, null);
    
    XYPlot plot = new XYPlot(getDataSet(movielist, source), dateAxis, valueAxis, renderer);
    
	plot.getRenderer().setSeriesPaint(0, XYCHART_COLOR);
	
	plot.setBackgroundPaint(XYBACKGROUND_COLOR);
	plot.setDomainGridlinePaint(GRIDLINECOLOR);
	plot.setRangeGridlinePaint(GRIDLINECOLOR);
    
    JFreeChart chart = new JFreeChart(plot);
    chart.removeLegend();
    
    chart.setBackgroundPaint(null);
    plot.getDomainAxis().setTickLabelPaint(TEXT_FOREGROUND);
    plot.getRangeAxis().setTickLabelPaint(TEXT_FOREGROUND);
    
	plot.getRangeAxis().setLabel(LocaleBundle.getString("StatisticsFrame.chartAxis.Size")); //$NON-NLS-1$
	plot.getDomainAxis().setLabel(LocaleBundle.getString("StatisticsFrame.chartAxis.Date")); //$NON-NLS-1$
	
	plot.getRangeAxis().setLabelPaint(TEXT_FOREGROUND);
	plot.getDomainAxis().setLabelPaint(TEXT_FOREGROUND);
    
    domainAxis = plot.getDomainAxis();
    
    return chart;
}
 
開發者ID:Mikescher,項目名稱:jClipCorn,代碼行數:35,代碼來源:StatisticsSizeOverTimeChart.java

示例3: createChart

@Override
protected JFreeChart createChart(CCMovieList movielist, StatisticsTypeFilter source) {
	if (chart != null) return chart;
	
	indexMap = new HashMap<>();
	datasetList = new HashMap<>();
	
	DateAxis dateAxis = new DateAxis(""); //$NON-NLS-1$

    DateFormat chartFormatter = new SimpleDateFormat("dd.MM.yyyy"); //$NON-NLS-1$
    dateAxis.setDateFormatOverride(chartFormatter);

    valueAxis = new NumberAxis(""); //$NON-NLS-1$
    valueAxis.setRange(0, 35);
    
    plot = new XYPlot(new DefaultXYDataset(), dateAxis, valueAxis, new StandardXYItemRenderer(StandardXYItemRenderer.LINES, null, null));
    
    List<TupleSeriesEpList> serieslist = getIncludedSeries(movielist);
    CCDate startdate = GetStartDate(serieslist);
    CCDate enddate = GetEndDate(serieslist);
    
    int idx = 0;
    for (TupleSeriesEpList series : serieslist) {
    	indexMap.put(series.series, idx);
    	
    	Color cf = new Color(StatisticsHelper.CHART_COLORS[idx % StatisticsHelper.CHART_COLORS.length]);
    	Color ca = new Color(cf.getRed(), cf.getGreen(), cf.getBlue(), 178);
    	
    	XYDataset dataset = getDataSet(series, startdate, enddate, false);
    	XYDataset startset = getDataSet(series, startdate, enddate, true);

    	datasetList.put(3*idx, dataset);
    	plot.setDataset(3*idx, dataset);
    	plot.setRenderer(3*idx, new XYAreaRenderer(XYAreaRenderer.AREA, null, null));
    	plot.getRenderer(3*idx).setSeriesPaint(0, ca);
    	plot.getRenderer(3*idx).setSeriesVisibleInLegend(0, false);

    	datasetList.put(3*idx + 1, dataset);
    	plot.setDataset(3*idx + 1, dataset);
    	plot.setRenderer(3*idx + 1, new StandardXYItemRenderer(StandardXYItemRenderer.LINES, null, null));
    	plot.getRenderer(3*idx + 1).setSeriesPaint(0, cf);
    	plot.getRenderer(3*idx + 1).setSeriesVisibleInLegend(0, false);

    	datasetList.put(3*idx + 2, startset);
    	plot.setDataset( 3*idx + 2, startset);
    	plot.setRenderer(3*idx + 2, new StandardXYItemRenderer(StandardXYItemRenderer.LINES, null, null));
    	plot.getRenderer(3*idx + 2).setSeriesPaint(0, cf);
    	plot.getRenderer(3*idx + 2).setSeriesVisibleInLegend(0, false);
    	plot.getRenderer(3*idx + 2).setBaseItemLabelGenerator(new StandardXYItemLabelGenerator("{0}")); //$NON-NLS-1$
    	plot.getRenderer(3*idx + 2).setBaseItemLabelPaint(cf);
    	plot.getRenderer(3*idx + 2).setBaseItemLabelsVisible(true);
    	plot.getRenderer(3*idx + 2).setBasePositiveItemLabelPosition(new ItemLabelPosition(ItemLabelAnchor.OUTSIDE12, TextAnchor.BOTTOM_LEFT, TextAnchor.BOTTOM_LEFT, -45));
    	plot.getRenderer(3*idx + 2).setSeriesItemLabelsVisible(0, true);
    	
    	idx++;
	}

       domainTotalRangeMin = startdate.asMilliseconds();
       domainTotalRangeMax = enddate.asMilliseconds();
    
       if (domainTotalRangeMin == domainTotalRangeMax) domainTotalRangeMax++;
       
	plot.setBackgroundPaint(XYBACKGROUND_COLOR);
	plot.setDomainGridlinePaint(GRIDLINECOLOR);
	plot.setRangeGridlinePaint(GRIDLINECOLOR);
    
    chart = new JFreeChart(plot);
    //chart.removeLegend();
    
    chart.setBackgroundPaint(null);
    plot.getDomainAxis().setTickLabelPaint(TEXT_FOREGROUND);
    plot.getRangeAxis().setTickLabelPaint(TEXT_FOREGROUND);
	plot.getRangeAxis().setStandardTickUnits(NumberAxis.createIntegerTickUnits());
    
    domainAxis = plot.getDomainAxis();
    
    return chart;
}
 
開發者ID:Mikescher,項目名稱:jClipCorn,代碼行數:78,代碼來源:StatisticsSeriesViewedChart.java

示例4: createChart

@Override
protected JFreeChart createChart(CCMovieList movielist, StatisticsTypeFilter source) {
	DateAxis dateAxis = new DateAxis(""); //$NON-NLS-1$

    DateFormat chartFormatter = new SimpleDateFormat("dd.MM.yyyy"); //$NON-NLS-1$
    dateAxis.setDateFormatOverride(chartFormatter);

    NumberAxis valueAxis = new NumberAxis(""); //$NON-NLS-1$
    
    XYPlot plot = new XYPlot(new DefaultXYDataset(), dateAxis, valueAxis, new StandardXYItemRenderer(StandardXYItemRenderer.LINES, null, null));

    List<DefaultXYDataset> datasets = getDataSet(movielist, source);
	LegendItemCollection coll = new LegendItemCollection();
    for (int idx = 0; idx < datasets.size(); idx++) {
    	Color cf = new Color(StatisticsHelper.CHART_COLORS[idx % StatisticsHelper.CHART_COLORS.length]);
    	Color ca = new Color(cf.getRed(), cf.getGreen(), cf.getBlue(), 50);
    	
    	plot.setDataset( 2*idx+0, datasets.get(idx));
    	plot.setRenderer(2*idx+0, new XYAreaRenderer(XYAreaRenderer.AREA, null, null));
    	plot.getRenderer(2*idx+0).setSeriesPaint(0, ca);
    	plot.getRenderer(2*idx+0).setSeriesVisibleInLegend(0, false);

    	plot.setDataset( 2*idx+1, datasets.get(idx));
    	plot.setRenderer(2*idx+1, new StandardXYItemRenderer(StandardXYItemRenderer.LINES, null, null));
    	plot.getRenderer(2*idx+1).setSeriesPaint(0, cf);
    	plot.getRenderer(2*idx+1).setSeriesVisibleInLegend(0, true);
    	plot.getRenderer(2*idx+1).setSeriesShape(0, ShapeUtilities.createDiamond(5));

		coll.add(new LegendItem(datasets.get(idx).getSeriesKey(0).toString(), "", "", "", ShapeUtilities.createDiamond(5), cf)); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
	}

	plot.setFixedLegendItems(coll);
	
	plot.setBackgroundPaint(XYBACKGROUND_COLOR);
	plot.setDomainGridlinePaint(GRIDLINECOLOR);
	plot.setRangeGridlinePaint(GRIDLINECOLOR);
    
	
    JFreeChart chart = new JFreeChart(plot);
    
    chart.setBackgroundPaint(null);
    plot.getDomainAxis().setTickLabelPaint(TEXT_FOREGROUND);
    plot.getRangeAxis().setTickLabelPaint(TEXT_FOREGROUND);
    
	plot.getDomainAxis().setLabel(LocaleBundle.getString("StatisticsFrame.chartAxis.Date")); //$NON-NLS-1$
	
	plot.getRangeAxis().setLabelPaint(TEXT_FOREGROUND);
	plot.getDomainAxis().setLabelPaint(TEXT_FOREGROUND);
	
	plot.getRangeAxis().setAutoRange(true);

    domainAxis = plot.getDomainAxis();
    
    return chart;
}
 
開發者ID:Mikescher,項目名稱:jClipCorn,代碼行數:55,代碼來源:StatisticsFormatOverTimeChart.java

示例5: createChart

@Override
protected JFreeChart createChart(CCMovieList movielist, StatisticsTypeFilter source) {
	DateAxis dateAxis = new DateAxis(""); //$NON-NLS-1$

    DateFormat chartFormatter = new SimpleDateFormat("dd.MM.yyyy"); //$NON-NLS-1$
    dateAxis.setDateFormatOverride(chartFormatter);

    NumberAxis valueAxis = new NumberAxis(""); //$NON-NLS-1$
    
    StandardXYItemRenderer renderer = new StandardXYItemRenderer(StandardXYItemRenderer.LINES, null, null);
    
    XYPlot plot = new XYPlot(getDataSet(movielist, source), dateAxis, valueAxis, renderer);
    
	plot.getRenderer().setSeriesPaint(0, XYCHART_COLOR);
	
	plot.setBackgroundPaint(XYBACKGROUND_COLOR);
	plot.setDomainGridlinePaint(GRIDLINECOLOR);
	plot.setRangeGridlinePaint(GRIDLINECOLOR);
    
    JFreeChart chart = new JFreeChart(plot);
    chart.removeLegend();
    
    chart.setBackgroundPaint(null);
    plot.getDomainAxis().setTickLabelPaint(TEXT_FOREGROUND);
    plot.getRangeAxis().setTickLabelPaint(TEXT_FOREGROUND);
    
    domainAxis = plot.getDomainAxis();
    
    return chart;
}
 
開發者ID:Mikescher,項目名稱:jClipCorn,代碼行數:30,代碼來源:StatisticsViewedOverTimeChart.java

示例6: createChart

@Override
protected JFreeChart createChart(CCMovieList movielist, StatisticsTypeFilter source) {
	NumberAxis xAxis = new NumberAxis(LocaleBundle.getString("StatisticsFrame.chartAxis.Length")); //$NON-NLS-1$

    NumberAxis yAxis = new NumberAxis(""); //$NON-NLS-1$
    
    yAxis.setStandardTickUnits(NumberAxis.createIntegerTickUnits());
    
    StandardXYItemRenderer renderer = new StandardXYItemRenderer(StandardXYItemRenderer.LINES, null, null);
    
    XYPlot plot = new XYPlot(getDataSet(movielist, source), xAxis, yAxis, renderer);
    
    plot.getRenderer().setSeriesPaint(0, XYCHART_COLOR);
    
    plot.setBackgroundPaint(XYBACKGROUND_COLOR);
	plot.setDomainGridlinePaint(GRIDLINECOLOR);
	plot.setRangeGridlinePaint(GRIDLINECOLOR);
    
    JFreeChart chart = new JFreeChart(plot);
    chart.removeLegend();
    
    chart.setBackgroundPaint(null);
    plot.getDomainAxis().setTickLabelPaint(TEXT_FOREGROUND);
    plot.getRangeAxis().setTickLabelPaint(TEXT_FOREGROUND);
    
    return chart;
}
 
開發者ID:Mikescher,項目名稱:jClipCorn,代碼行數:27,代碼來源:StatisticsLengthChart.java

示例7: createChart

@Override
protected JFreeChart createChart(CCMovieList movielist, StatisticsTypeFilter source) {
	DateAxis dateAxis = new DateAxis(""); //$NON-NLS-1$

    DateFormat chartFormatter = new SimpleDateFormat("dd.MM.yyyy"); //$NON-NLS-1$
    dateAxis.setDateFormatOverride(chartFormatter);

    NumberAxis valueAxis = new NumberAxis(""); //$NON-NLS-1$

    StandardXYItemRenderer renderer = new StandardXYItemRenderer(StandardXYItemRenderer.LINES, null, null);
    
    XYPlot plot = new XYPlot(getDataSet(movielist, source), dateAxis, valueAxis, renderer);
    
	plot.getRenderer().setSeriesPaint(0, XYCHART_COLOR);
	
	plot.setBackgroundPaint(XYBACKGROUND_COLOR);
	plot.setDomainGridlinePaint(GRIDLINECOLOR);
	plot.setRangeGridlinePaint(GRIDLINECOLOR);
    
    JFreeChart chart = new JFreeChart(plot);
    chart.removeLegend();
    
    chart.setBackgroundPaint(null);
    plot.getDomainAxis().setTickLabelPaint(TEXT_FOREGROUND);
    plot.getRangeAxis().setTickLabelPaint(TEXT_FOREGROUND);
    
	plot.getRangeAxis().setLabel(LocaleBundle.getString("StatisticsFrame.chartAxis.Mins")); //$NON-NLS-1$
	plot.getDomainAxis().setLabel(LocaleBundle.getString("StatisticsFrame.chartAxis.Date")); //$NON-NLS-1$
	
	plot.getRangeAxis().setLabelPaint(TEXT_FOREGROUND);
	plot.getDomainAxis().setLabelPaint(TEXT_FOREGROUND);
    
    domainAxis = plot.getDomainAxis();
    
    return chart;
}
 
開發者ID:Mikescher,項目名稱:jClipCorn,代碼行數:36,代碼來源:StatisticsLengthOverTimeChart.java

示例8: createChart

@Override
protected JFreeChart createChart(CCMovieList movielist, StatisticsTypeFilter source) {
	DateAxis dateAxis = new DateAxis(""); //$NON-NLS-1$

    DateFormat chartFormatter = new SimpleDateFormat("dd.MM.yyyy"); //$NON-NLS-1$
    dateAxis.setDateFormatOverride(chartFormatter);

    NumberAxis valueAxis = new NumberAxis(""); //$NON-NLS-1$
    
    //StandardXYToolTipGenerator ttg = new StandardXYToolTipGenerator("{1}: {2}",new SimpleDateFormat("dd.MM.yyyy"), new DecimalFormat()); //$NON-NLS-1$ //$NON-NLS-2$

    StandardXYItemRenderer renderer = new StandardXYItemRenderer(StandardXYItemRenderer.LINES, null, null);
    
    XYPlot plot = new XYPlot(getDataSet(movielist, source), dateAxis, valueAxis, renderer);
    
	plot.getRenderer().setSeriesPaint(0, XYCHART_COLOR);
	
	plot.setBackgroundPaint(XYBACKGROUND_COLOR);
	plot.setDomainGridlinePaint(GRIDLINECOLOR);
	plot.setRangeGridlinePaint(GRIDLINECOLOR);
    
    JFreeChart chart = new JFreeChart(plot);
    chart.removeLegend();
    
    chart.setBackgroundPaint(null);
    plot.getDomainAxis().setTickLabelPaint(TEXT_FOREGROUND);
    plot.getRangeAxis().setTickLabelPaint(TEXT_FOREGROUND);
    
    domainAxis = plot.getDomainAxis();
    
    return chart;
}
 
開發者ID:Mikescher,項目名稱:jClipCorn,代碼行數:32,代碼來源:StatisticsAddDateChart.java


注:本文中的org.jfree.chart.renderer.xy.StandardXYItemRenderer.LINES屬性示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。