本文整理匯總了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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}