本文整理汇总了Java中org.jfree.chart.renderer.xy.XYLineAndShapeRenderer.setLegendItemLabelGenerator方法的典型用法代码示例。如果您正苦于以下问题:Java XYLineAndShapeRenderer.setLegendItemLabelGenerator方法的具体用法?Java XYLineAndShapeRenderer.setLegendItemLabelGenerator怎么用?Java XYLineAndShapeRenderer.setLegendItemLabelGenerator使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.jfree.chart.renderer.xy.XYLineAndShapeRenderer
的用法示例。
在下文中一共展示了XYLineAndShapeRenderer.setLegendItemLabelGenerator方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createLegend
import org.jfree.chart.renderer.xy.XYLineAndShapeRenderer; //导入方法依赖的package包/类
protected JFreeChart createLegend(XYDataset dataset) {
JFreeChart chart = ChartFactory.createXYLineChart(
chartTitle, // chart title
domainLabel, // domain axis label
rangeLabel, // range axis label
dataset, // data
PlotOrientation.VERTICAL, // orientation
true, // include legend
true, // tooltips
false // url
);
// NOW DO SOME OPTIONAL CUSTOMISATION OF THE CHART...
chart.setBackgroundPaint(Color.white);
XYPlot plot = (XYPlot) chart.getPlot();
XYLineAndShapeRenderer renderer
= (XYLineAndShapeRenderer) plot.getRenderer();
renderer.setBaseShapesVisible(true);
renderer.setBaseShapesFilled(true);
renderer.setLegendItemLabelGenerator(new SOCRXYSeriesLabelGenerator());
return chart;
}
示例2: createChart
import org.jfree.chart.renderer.xy.XYLineAndShapeRenderer; //导入方法依赖的package包/类
protected JFreeChart createChart(XYDataset dataset) {
SymbolAxis domainAxis = new SymbolAxis("Domain",
new String[] {"A", "B", "C", "D"});
SymbolAxis rangeAxis = new SymbolAxis("Range",
new String[] {"V", "X", "Y", "Z"});
XYLineAndShapeRenderer renderer = new XYLineAndShapeRenderer(false, true);
if (!legendPanelOn)
renderer.setLegendItemLabelGenerator(new SOCRXYSeriesLabelGenerator());
XYPlot plot = new XYPlot(dataset, domainAxis, rangeAxis, renderer);
JFreeChart chart = new JFreeChart(chartTitle, plot);
setXSummary(dataset);
if (legendPanelOn)
chart.removeLegend();
return chart;
}
示例3: createChart
import org.jfree.chart.renderer.xy.XYLineAndShapeRenderer; //导入方法依赖的package包/类
/**
* Creates a chart.
*
* @param dataset a dataset.
*
* @return A chart based on the supplied dataset.
*/
protected JFreeChart createChart(XYDataset dataset) {
JFreeChart chart = ChartFactory.createXYLineChart(
chartTitle, // chart title
domainLabel, // x axis label
rangeLabel, // y axis label
dataset, // data
PlotOrientation.VERTICAL,
!legendPanelOn, // include legend
true, // tooltips
false // urls
);
// NOW DO SOME OPTIONAL CUSTOMISATION OF THE CHART...
// get a reference to the plot for further customisation...
XYPlot plot = (XYPlot) chart.getPlot();
XYLineAndShapeRenderer renderer
= (XYLineAndShapeRenderer) plot.getRenderer();
renderer.setBaseShapesVisible(true);
renderer.setBaseShapesFilled(true);
renderer.setDrawOutlines(true);
renderer.setLegendItemLabelGenerator(new SOCRXYSeriesLabelGenerator());
// change the auto tick unit selection to integer units only...
NumberAxis rangeAxis = (NumberAxis) plot.getRangeAxis();
rangeAxis.setStandardTickUnits(NumberAxis.createIntegerTickUnits());
NumberAxis domainAxis = (NumberAxis) plot.getDomainAxis();
domainAxis.setStandardTickUnits(NumberAxis.createIntegerTickUnits());
setXSummary(dataset);
return chart;
}
示例4: createChart
import org.jfree.chart.renderer.xy.XYLineAndShapeRenderer; //导入方法依赖的package包/类
/**
* Creates a chart.
*
* @param dataset the data for the chart.
*
* @return a chart.
*/
protected JFreeChart createChart(XYDataset dataset) {
// create the chart...
JFreeChart chart = ChartFactory.createXYLineChart(
chartTitle, // chart title
domainLabel, // x axis label
rangeLabel, // y axis label
dataset, // data
PlotOrientation.VERTICAL,
!legendPanelOn, // include legend
true, // tooltips
false // urls
);
// NOW DO SOME OPTIONAL CUSTOMISATION OF THE CHART...
chart.setBackgroundPaint(Color.white);
// get a reference to the plot for further customisation...
XYPlot plot = (XYPlot) chart.getPlot();
plot.setBackgroundPaint(Color.lightGray);
plot.setAxisOffset(new RectangleInsets(5.0, 5.0, 5.0, 5.0));
plot.setDomainGridlinePaint(Color.white);
plot.setRangeGridlinePaint(Color.white);
XYLineAndShapeRenderer renderer
= (XYLineAndShapeRenderer) plot.getRenderer();
renderer.setBaseShapesVisible(true);
renderer.setBaseShapesFilled(true);
renderer.setLegendItemLabelGenerator(new SOCRXYSeriesLabelGenerator());
// change the auto tick unit selection to integer units only...
NumberAxis rangeAxis = (NumberAxis) plot.getRangeAxis();
rangeAxis.setStandardTickUnits(NumberAxis.createIntegerTickUnits());
// OPTIONAL CUSTOMISATION COMPLETED.
setXSummary(dataset);
return chart;
}
示例5: createChart
import org.jfree.chart.renderer.xy.XYLineAndShapeRenderer; //导入方法依赖的package包/类
/**
* Creates a chart.
*
* @param dataset the data for the chart.
*
* @return a chart.
*/
protected JFreeChart createChart(XYDataset dataset) {
JFreeChart chart = ChartFactory.createXYLineChart(
chartTitle, // chart title
domainLabel, // x axis label
rangeLabel, // y axis label
dataset, // data
PlotOrientation.VERTICAL,
!legendPanelOn, // include legend
true, // tooltips
false // urls
);
chart.setBackgroundPaint(Color.white);
XYPlot plot = chart.getXYPlot();
plot.setBackgroundPaint(Color.lightGray);
plot.setAxisOffset(new RectangleInsets(5.0, 5.0, 5.0, 5.0));
plot.setDomainGridlinePaint(Color.white);
plot.setRangeGridlinePaint(Color.white);
plot.setDomainCrosshairVisible(true);
plot.setRangeCrosshairVisible(true);
XYLineAndShapeRenderer renderer
= (XYLineAndShapeRenderer) plot.getRenderer();
renderer.setBaseShapesVisible(true);
renderer.setBaseShapesFilled(true);
renderer.setLegendItemLabelGenerator(new SOCRXYSeriesLabelGenerator());
// change the auto tick unit selection to integer units only...
NumberAxis rangeAxis = (NumberAxis) plot.getRangeAxis();
rangeAxis.setStandardTickUnits(NumberAxis.createIntegerTickUnits());
setXSummary(dataset);
return chart;
}
示例6: createChart
import org.jfree.chart.renderer.xy.XYLineAndShapeRenderer; //导入方法依赖的package包/类
/**
* Creates a chart.
*
* @param dataset the data for the chart.
*
* @return a chart.
*/
protected JFreeChart createChart(XYDataset dataset) {
// create the chart...
JFreeChart chart = ChartFactory.createXYLineChart(
chartTitle, // chart title
domainLabel, // x axis label
rangeLabel, // y axis label
dataset, // data
PlotOrientation.VERTICAL,
!legendPanelOn, // include legend
true, // tooltips
false // urls
);
// NOW DO SOME OPTIONAL CUSTOMISATION OF THE CHART...
chart.setBackgroundPaint(Color.white);
// get a reference to the plot for further customisation...
XYPlot plot = (XYPlot) chart.getPlot();
plot.setBackgroundPaint(Color.lightGray);
plot.setAxisOffset(new RectangleInsets(5.0, 5.0, 5.0, 5.0));
plot.setDomainGridlinePaint(Color.white);
plot.setRangeGridlinePaint(Color.white);
XYLineAndShapeRenderer renderer
= (XYLineAndShapeRenderer) plot.getRenderer();
renderer.setBaseShapesVisible(true);
renderer.setBaseShapesFilled(true);
renderer.setBaseLinesVisible(false);
renderer.setLegendItemLabelGenerator(new SOCRXYSeriesLabelGenerator());
// change the auto tick unit selection to integer units only...
NumberAxis rangeAxis = (NumberAxis) plot.getRangeAxis();
rangeAxis.setStandardTickUnits(NumberAxis.createIntegerTickUnits());
rangeAxis.setAutoRangeIncludesZero(false);
rangeAxis.setUpperMargin(0);
rangeAxis.setLowerMargin(0);
NumberAxis domainAxis = (NumberAxis) plot.getDomainAxis();
domainAxis.setStandardTickUnits(NumberAxis.createIntegerTickUnits());
domainAxis.setAutoRangeIncludesZero(false);
domainAxis.setUpperMargin(0);
domainAxis.setLowerMargin(0);
// OPTIONAL CUSTOMISATION COMPLETED.
setXSummary(dataset);
return chart;
}
示例7: createChart1
import org.jfree.chart.renderer.xy.XYLineAndShapeRenderer; //导入方法依赖的package包/类
/**
* Creates a chart.
*
* @param dataset the data for the chart.
*
* @return a chart.
*/
protected JFreeChart createChart1(XYDataset dataset) {
//System.out.println("createChart1 called");
// create the chart...
JFreeChart chart = ChartFactory.createXYLineChart(
chartTitle, // chart title
"", // x axis label domain
rangeLabel, // y axis label range
dataset, // data
PlotOrientation.HORIZONTAL,
!legendPanelOn, // include legend
true, // tooltips
false // urls
);
// NOW DO SOME OPTIONAL CUSTOMISATION OF THE CHART...
chart.setBackgroundPaint(Color.white);
// get a reference to the plot for further customisation...
XYPlot plot = (XYPlot) chart.getPlot();
plot.setBackgroundPaint(Color.white);
plot.setAxisOffset(new RectangleInsets(5.0, 5.0, 5.0, 5.0));
plot.setDomainGridlinePaint(Color.lightGray);
plot.setRangeGridlinePaint(Color.lightGray);
XYLineAndShapeRenderer renderer
= (XYLineAndShapeRenderer) plot.getRenderer();
// renderer.setSeriesShape(0, java.awt.Shape.round);
renderer.setBaseShapesVisible(true);
renderer.setBaseShapesFilled(true);
renderer.setBaseLinesVisible(false);
renderer.setLegendItemLabelGenerator(new SOCRXYSeriesLabelGenerator());
//change the auto tick unit selection to integer units only...
NumberAxis rangeAxis = (NumberAxis) plot.getRangeAxis();
rangeAxis.setStandardTickUnits(NumberAxis.createIntegerTickUnits());
rangeAxis.setAutoRangeIncludesZero(true);
rangeAxis.setUpperMargin(0.01);
rangeAxis.setLowerMargin(0.01);
NumberAxis domainAxis = (NumberAxis) plot.getDomainAxis();
//domainAxis.setStandardTickUnits(NumberAxis.createIntegerTickUnits());
domainAxis.setAutoRangeIncludesZero(true);
domainAxis.setTickLabelsVisible(false);
domainAxis.setTickMarksVisible(false);
domainAxis.setUpperMargin(5);
domainAxis.setLowerMargin(0.01);
// OPTIONAL CUSTOMISATION COMPLETED.
setYSummary(dataset);
try{
// System.out.println("setting the common RangeAxis to null");
common_rangeAxis = null;
common_rangeAxis = (NumberAxis)rangeAxis.clone();
// System.out.println("creating the common RangeAxis");
}catch(CloneNotSupportedException e){
System.out.println("CloneNotSupportedException!, exception caught");
}
return chart;
}
示例8: createChart
import org.jfree.chart.renderer.xy.XYLineAndShapeRenderer; //导入方法依赖的package包/类
/**
* Creates a chart.
*
* @param dataset the data for the chart.
*
* @return a chart.
*/
protected JFreeChart createChart(XYDataset dataset) {
// create the chart...
JFreeChart chart = ChartFactory.createXYLineChart(
chartTitle, //"Power Transformed XYScatter Chart", // chart title
domainLabel, // x axis label
rangeLabel, // y axis label
dataset, // data
PlotOrientation.VERTICAL,
true, // include legend
true, // tooltips
false // urls
);
// NOW DO SOME OPTIONAL CUSTOMISATION OF THE CHART...
chart.setBackgroundPaint(Color.white);
// get a reference to the plot for further customisation...
XYPlot plot = (XYPlot) chart.getPlot();
plot.setBackgroundPaint(Color.lightGray);
plot.setAxisOffset(new RectangleInsets(5.0, 5.0, 5.0, 5.0));
plot.setDomainGridlinePaint(Color.white);
plot.setRangeGridlinePaint(Color.white);
XYLineAndShapeRenderer renderer
= (XYLineAndShapeRenderer) plot.getRenderer();
renderer.setBaseShapesVisible(true);
renderer.setBaseShapesFilled(true);
// renderer.setLinesVisible(false);
renderer.setSeriesLinesVisible(1, true);
renderer.setSeriesShapesVisible(1, true);
renderer.setSeriesLinesVisible(0, false);
renderer.setSeriesShapesVisible(0, true);
renderer.setLegendItemLabelGenerator(new SOCRXYSeriesLabelGenerator());
// change the auto tick unit selection to integer units only...
NumberAxis rangeAxis = (NumberAxis) plot.getRangeAxis();
rangeAxis.setStandardTickUnits(NumberAxis.createIntegerTickUnits());
rangeAxis.setAutoRangeIncludesZero(false);
rangeAxis.setUpperMargin(0);
rangeAxis.setLowerMargin(0);
NumberAxis domainAxis = (NumberAxis) plot.getDomainAxis();
domainAxis.setStandardTickUnits(NumberAxis.createIntegerTickUnits());
domainAxis.setAutoRangeIncludesZero(false);
domainAxis.setUpperMargin(0);
domainAxis.setLowerMargin(0);
// OPTIONAL CUSTOMISATION COMPLETED.
setXSummary(dataset);
return chart;
}
示例9: createChart
import org.jfree.chart.renderer.xy.XYLineAndShapeRenderer; //导入方法依赖的package包/类
/**
* Creates a chart.
*
* @param dataset the data for the chart.
*
* @return a chart.
*/
protected JFreeChart createChart(XYDataset dataset) {
// create the chart...
JFreeChart chart = ChartFactory.createXYLineChart(
chartTitle, // chart title
domainLabel, // x axis label
rangeLabel, // y axis label
dataset, // data
PlotOrientation.VERTICAL,
!legendPanelOn, // include legend
true, // tooltips
false // urls
);
// NOW DO SOME OPTIONAL CUSTOMISATION OF THE CHART...
chart.setBackgroundPaint(Color.white);
// get a reference to the plot for further customisation...
XYPlot plot = (XYPlot) chart.getPlot();
plot.setBackgroundPaint(Color.white);
plot.setAxisOffset(new RectangleInsets(5.0, 5.0, 5.0, 5.0));
plot.setDomainGridlinePaint(Color.lightGray);
plot.setRangeGridlinePaint(Color.lightGray);
XYLineAndShapeRenderer renderer
= (XYLineAndShapeRenderer) plot.getRenderer();
// renderer.setSeriesShape(0, java.awt.Shape.round);
renderer.setBaseShapesVisible(false);
renderer.setBaseShapesFilled(false);
renderer.setBaseLinesVisible(true);
renderer.setLegendItemLabelGenerator(new SOCRXYSeriesLabelGenerator());
//change the auto tick unit selection to integer units only...
NumberAxis rangeAxis = (NumberAxis) plot.getRangeAxis();
rangeAxis.setStandardTickUnits(NumberAxis.createIntegerTickUnits());
rangeAxis.setAutoRangeIncludesZero(false);
rangeAxis.setUpperMargin(0.05);
rangeAxis.setLowerMargin(0.05);
NumberAxis domainAxis = (NumberAxis) plot.getDomainAxis();
domainAxis.setStandardTickUnits(NumberAxis.createIntegerTickUnits());
domainAxis.setAutoRangeIncludesZero(false);
// domainAxis.setTickLabelsVisible(false);
// domainAxis.setTickMarksVisible(false);
domainAxis.setUpperMargin(0.05);
domainAxis.setLowerMargin(0.05);
// OPTIONAL CUSTOMISATION COMPLETED.
setYSummary(dataset);
return chart;
}
示例10: createChart
import org.jfree.chart.renderer.xy.XYLineAndShapeRenderer; //导入方法依赖的package包/类
/**
* Creates a chart.
*
* @param dataset the data for the chart.
*
* @return a chart.
*/
protected JFreeChart createChart(XYDataset dataset) {
chartTitle = "Power Transform Chart";
// create the chart...
JFreeChart chart = ChartFactory.createXYLineChart(
chartTitle,//"Power Transform Chart", // chart title
domainLabel, // x axis label
rangeLabel, // y axis label
dataset, // data
PlotOrientation.VERTICAL,
!legendPanelOn, // include legend
true, // tooltips
false // urls
);
toolBar.setLayout(new FlowLayout(FlowLayout.LEFT));
// NOW DO SOME OPTIONAL CUSTOMISATION OF THE CHART...
chart.setBackgroundPaint(Color.white);
// get a reference to the plot for further customisation...
XYPlot plot = (XYPlot) chart.getPlot();
plot.setBackgroundPaint(Color.white);
plot.setAxisOffset(new RectangleInsets(5.0, 5.0, 5.0, 5.0));
plot.setDomainGridlinePaint(Color.lightGray);
plot.setRangeGridlinePaint(Color.lightGray);
XYLineAndShapeRenderer renderer
= (XYLineAndShapeRenderer) plot.getRenderer();
// renderer.setSeriesShape(0, java.awt.Shape.round);
renderer.setBaseShapesVisible(false);
renderer.setBaseShapesFilled(false);
renderer.setBaseLinesVisible(true);
renderer.setLegendItemLabelGenerator(new SOCRXYSeriesLabelGenerator());
//change the auto tick unit selection to integer units only...
NumberAxis rangeAxis = (NumberAxis) plot.getRangeAxis();
rangeAxis.setStandardTickUnits(NumberAxis.createIntegerTickUnits());
rangeAxis.setAutoRangeIncludesZero(false);
rangeAxis.setUpperMargin(0.05);
rangeAxis.setLowerMargin(0.05);
NumberAxis domainAxis = (NumberAxis) plot.getDomainAxis();
domainAxis.setStandardTickUnits(NumberAxis.createIntegerTickUnits());
domainAxis.setAutoRangeIncludesZero(false);
// domainAxis.setTickLabelsVisible(false);
// domainAxis.setTickMarksVisible(false);
domainAxis.setUpperMargin(0.05);
domainAxis.setLowerMargin(0.05);
// OPTIONAL CUSTOMISATION COMPLETED.
setYSummary(dataset);
return chart;
}
示例11: createChart
import org.jfree.chart.renderer.xy.XYLineAndShapeRenderer; //导入方法依赖的package包/类
/**
* Creates a chart.
*
* @param dataset the data for the chart.
*
* @return a chart.
*/
protected JFreeChart createChart(XYDataset dataset) {
// create the chart...
JFreeChart chart = ChartFactory.createXYLineChart(
chartTitle, // chart title
domainLabel, // x axis label
rangeLabel, // y axis label
dataset, // data
PlotOrientation.VERTICAL,
!legendPanelOn, // include legend
true, // tooltips
false // urls
);
// NOW DO SOME OPTIONAL CUSTOMISATION OF THE CHART...
chart.setBackgroundPaint(Color.white);
// get a reference to the plot for further customisation...
XYPlot plot = (XYPlot) chart.getPlot();
plot.setBackgroundPaint(Color.white);
plot.setAxisOffset(new RectangleInsets(5.0, 5.0, 5.0, 5.0));
plot.setDomainGridlinePaint(Color.lightGray);
plot.setRangeGridlinePaint(Color.lightGray);
XYLineAndShapeRenderer renderer
= (XYLineAndShapeRenderer) plot.getRenderer();
// renderer.setSeriesShape(0, java.awt.Shape.round);
renderer.setBaseShapesVisible(false);
renderer.setBaseShapesFilled(false);
renderer.setBaseLinesVisible(true);
renderer.setLegendItemLabelGenerator(new SOCRXYSeriesLabelGenerator());
//change the auto tick unit selection to integer units only...
NumberAxis rangeAxis = (NumberAxis) plot.getRangeAxis();
rangeAxis.setStandardTickUnits(NumberAxis.createIntegerTickUnits());
rangeAxis.setAutoRangeIncludesZero(false);
rangeAxis.setUpperMargin(0.05);
rangeAxis.setLowerMargin(0.05);
NumberAxis domainAxis = (NumberAxis) plot.getDomainAxis();
domainAxis.setStandardTickUnits(NumberAxis.createIntegerTickUnits());
domainAxis.setAutoRangeIncludesZero(false);
// domainAxis.setTickLabelsVisible(false);
// domainAxis.setTickMarksVisible(false);
domainAxis.setUpperMargin(0.05);
domainAxis.setLowerMargin(0.05);
// OPTIONAL CUSTOMISATION COMPLETED.
setYSummary(dataset);
return chart;
}