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