当前位置: 首页>>代码示例>>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;未经允许,请勿转载。