本文整理汇总了Java中org.jfree.chart.renderer.xy.XYLineAndShapeRenderer.setSeriesShapesVisible方法的典型用法代码示例。如果您正苦于以下问题:Java XYLineAndShapeRenderer.setSeriesShapesVisible方法的具体用法?Java XYLineAndShapeRenderer.setSeriesShapesVisible怎么用?Java XYLineAndShapeRenderer.setSeriesShapesVisible使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.jfree.chart.renderer.xy.XYLineAndShapeRenderer
的用法示例。
在下文中一共展示了XYLineAndShapeRenderer.setSeriesShapesVisible方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createChart
import org.jfree.chart.renderer.xy.XYLineAndShapeRenderer; //导入方法依赖的package包/类
private JFreeChart createChart(XYSeriesCollection xySeriesCollection) {
JFreeChart chart = ChartFactory.createXYLineChart(
"PlotDemo",
"X",
"Y",
xySeriesCollection,
PlotOrientation.VERTICAL,
true,
true,
false);
chart.setBackgroundPaint(Color.white);
//...Устанавливаем правила для серий
XYLineAndShapeRenderer renderer = new XYLineAndShapeRenderer();
renderer.setSeriesLinesVisible(2, false);
renderer.setSeriesShapesVisible(1, false);
renderer.setSeriesPaint(0, Color.orange);
renderer.setSeriesPaint(1, Color.red);
renderer.setSeriesPaint(2, Color.blue);
XYPlot plot = chart.getXYPlot();
plot.setOutlinePaint(Color.cyan);
plot.setRenderer(renderer);
return chart;
}
示例2: OrderParameterVsTimeChart
import org.jfree.chart.renderer.xy.XYLineAndShapeRenderer; //导入方法依赖的package包/类
public OrderParameterVsTimeChart( int maxItemCount ) {
this.maxItemCount = maxItemCount;
meanSeries = new XYSeries( "Order Parameter vs Time" );
xySeriesCollection = new XYSeriesCollection( meanSeries );
domainAxis = new NumberAxis( "Time" );
rangeAxis = new NumberAxis( "Order Parameter" );
renderer = new XYLineAndShapeRenderer();
int MEAN_SERIES = 0;
renderer.setSeriesStroke( MEAN_SERIES, new BasicStroke( 2 ) );
renderer.setSeriesLinesVisible( MEAN_SERIES, true );
renderer.setSeriesShapesVisible( MEAN_SERIES, false );
xyPlot = new XYPlot( xySeriesCollection,
domainAxis,
rangeAxis, renderer );
chart = new JFreeChart( "Order Parameter vs. Time", xyPlot );
rangeAxis.setRange( -0.01, 1.01 );
domainAxis.setAutoRange( false );
domainAxis.setRange( 0, maxItemCount * PlotOrderParameterVsTime.MOD );
}
示例3: createChart
import org.jfree.chart.renderer.xy.XYLineAndShapeRenderer; //导入方法依赖的package包/类
/**
* Creates a sample chart.
*
* @param dataset a dataset for the chart.
* @return A sample chart.
*/
private static JFreeChart createChart( XYDataset dataset ) {
JFreeChart chart = ChartFactory.createXYLineChart(
"XYLineAndShapeRenderer Demo 1",
"X",
"Y",
dataset,
PlotOrientation.VERTICAL,
true,
true,
false
);
XYPlot plot = (XYPlot)chart.getPlot();
XYLineAndShapeRenderer renderer = new XYLineAndShapeRenderer();
renderer.setSeriesLinesVisible( 0, true );
renderer.setSeriesShapesVisible( 0, false );
renderer.setSeriesLinesVisible( 1, true );
renderer.setSeriesShapesVisible( 1, false );
renderer.setToolTipGenerator( new StandardXYToolTipGenerator() );
renderer.setDefaultEntityRadius( 6 );
plot.setRenderer( renderer );
return chart;
}
示例4: createFitJFreeCharts
import org.jfree.chart.renderer.xy.XYLineAndShapeRenderer; //导入方法依赖的package包/类
private void createFitJFreeCharts(XYSeriesCollection viSeriesCollection) {
for (int csvCount = 0; csvCount < csvFiles.length; csvCount++) {
// create chart
XYSeriesCollection xysc = new XYSeriesCollection();
xysc.addSeries(viSeriesCollection.getSeries(bestFittingScenarios[csvCount].getScenarioIndex() + csvFiles.length));
xysc.addSeries(viSeriesCollection.getSeries(csvCount));
JFreeChart fcchart = ChartFactory.createXYLineChart("Fitting i(v) curve to csv #" + csvCount, "v (V)", "i (mA)",
xysc, PlotOrientation.VERTICAL, false, true, true);
XYLineAndShapeRenderer bfsRenderer = new XYLineAndShapeRenderer();
bfsRenderer.setSeriesShapesVisible(0, false);
bfsRenderer.setSeriesLinesVisible(0, true);
bfsRenderer.setSeriesShapesVisible(1, true);
bfsRenderer.setSeriesLinesVisible(1, true);
fcchart.getXYPlot().setRenderer(bfsRenderer);
applyXYChartTheme(fcchart, logI, minIPlotted);
allCharts.add(fcchart);
}
}
示例5: SmoothingChartContainer
import org.jfree.chart.renderer.xy.XYLineAndShapeRenderer; //导入方法依赖的package包/类
public SmoothingChartContainer()
{
dataset = new DefaultXYDataset();
dataset.addSeries(NOISY_SERIES_KEY, new double[][] {{0},{0}});
dataset.addSeries(SMOOTH_SERIES_KEY, new double[][] {{0},{0}});
noisySeriesIndex = 0;
smoothSeriesIndex = 1;
renderer = new XYLineAndShapeRenderer();
XYPlot plot = new XYPlot(dataset, new NumberAxis("Time"), new NumberAxis(), renderer);
chart = new JFreeChart(plot);
plot.setDrawingSupplier(ChartUtils.createDrawingSupplier());
renderer.setSeriesLinesVisible(noisySeriesIndex, false);
renderer.setSeriesShapesVisible(noisySeriesIndex, true);
renderer.setSeriesLinesVisible(smoothSeriesIndex, true);
renderer.setSeriesShapesVisible(smoothSeriesIndex, false);
}
示例6: addSerie
import org.jfree.chart.renderer.xy.XYLineAndShapeRenderer; //导入方法依赖的package包/类
public void addSerie(int indexSerie, Color color, XYSeries localXYSeries){
XYSeriesCollection localXYSeriesCollection = new XYSeriesCollection();
localXYSeriesCollection.addSeries(localXYSeries); //Se aniade la serie
Ellipse2D.Double localDouble = new Ellipse2D.Double(-4.0D, -4.0D, 8.0D, 8.0D); //Forma de la anotacion del punto x,y
XYLineAndShapeRenderer localXYLineAndShapeRenderer = new XYLineAndShapeRenderer();
localXYLineAndShapeRenderer.setSeriesLinesVisible(indexSerie,true); //provoca que se pinten lineas rectas que unen los puntos x,y que conforman la serie
localXYLineAndShapeRenderer.setSeriesShapesVisible(indexSerie,false); //provoca que se pinte la forma asociada al punto x,y
plot.setDataset(indexSerie, localXYSeriesCollection); //Se aniade la serie al plot
plot.setRenderer(indexSerie, localXYLineAndShapeRenderer);
localXYLineAndShapeRenderer.setSeriesShape(indexSerie, new Ellipse2D.Double(-4.0, -4.0, 8.0, 8.0));
// localXYLineAndShapeRenderer.setSeriesShape(indexSerie, localDouble);
localXYLineAndShapeRenderer.setSeriesPaint(indexSerie, color);
//localXYLineAndShapeRenderer.setSeriesFillPaint(indexSerie, Color.yellow);
//localXYLineAndShapeRenderer.setSeriesOutlinePaint(indexSerie, Color.gray);
localXYLineAndShapeRenderer.setUseFillPaint(false);//true
localXYLineAndShapeRenderer.setUseOutlinePaint(false);//true
localXYLineAndShapeRenderer.setDrawOutlines(false);
localXYLineAndShapeRenderer.setDrawSeriesLineAsPath(true);
}
示例7: addSerie
import org.jfree.chart.renderer.xy.XYLineAndShapeRenderer; //导入方法依赖的package包/类
public void addSerie(int indexSerie, Color color, XYSeries localXYSeries){
XYPlot plot=null;
XYSeriesCollection localXYSeriesCollection = new XYSeriesCollection();
localXYSeriesCollection.addSeries(localXYSeries); //Se aniade la serie
Ellipse2D.Double localDouble = new Ellipse2D.Double(-4.0D, -4.0D, 8.0D, 8.0D); //Forma de la anotacion del punto x,y
XYLineAndShapeRenderer localXYLineAndShapeRenderer = new XYLineAndShapeRenderer();
localXYLineAndShapeRenderer.setSeriesLinesVisible(indexSerie,true); //provoca que se pinten lineas rectas que unen los puntos x,y que conforman la serie
localXYLineAndShapeRenderer.setSeriesShapesVisible(indexSerie,false); //provoca que se pinte la forma asociada al punto x,y
plot.setDataset(indexSerie, localXYSeriesCollection); //Se aniade la serie al plot
plot.setRenderer(indexSerie, localXYLineAndShapeRenderer);
localXYLineAndShapeRenderer.setSeriesShape(indexSerie, new Ellipse2D.Double(-4.0, -4.0, 8.0, 8.0));
// localXYLineAndShapeRenderer.setSeriesShape(indexSerie, localDouble);
localXYLineAndShapeRenderer.setSeriesPaint(indexSerie, color);
//localXYLineAndShapeRenderer.setSeriesFillPaint(indexSerie, Color.yellow);
//localXYLineAndShapeRenderer.setSeriesOutlinePaint(indexSerie, Color.gray);
localXYLineAndShapeRenderer.setUseFillPaint(false);//true
localXYLineAndShapeRenderer.setUseOutlinePaint(false);//true
localXYLineAndShapeRenderer.setDrawOutlines(false);
localXYLineAndShapeRenderer.setDrawSeriesLineAsPath(true);
}
示例8: createChartXY
import org.jfree.chart.renderer.xy.XYLineAndShapeRenderer; //导入方法依赖的package包/类
/**
* Creates a chart.
*
* @param dataset
* the data for the chart.
*
* @return a chart.
*/
private JFreeChart createChartXY(final XYDataset dataset) {
// create the chart...
final JFreeChart chart = ChartFactory.createXYLineChart("Line Chart Demo 6", // chart
// title
"X", // x axis label
"Y", // 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);
// final StandardLegend legend = (StandardLegend) chart.getLegend();
// legend.setDisplaySeriesShapes(true);
// get a reference to the plot for further customisation...
final XYPlot plot = chart.getXYPlot();
plot.setBackgroundPaint(Color.lightGray);
// plot.setAxisOffset(new Spacer(Spacer.ABSOLUTE, 5.0, 5.0, 5.0, 5.0));
plot.setDomainGridlinePaint(Color.white);
plot.setRangeGridlinePaint(Color.white);
final XYLineAndShapeRenderer renderer = new XYLineAndShapeRenderer();
renderer.setSeriesLinesVisible(0, false);
renderer.setSeriesShapesVisible(1, false);
plot.setRenderer(renderer);
// change the auto tick unit selection to integer units only...
final NumberAxis rangeAxis = (NumberAxis) plot.getRangeAxis();
rangeAxis.setStandardTickUnits(NumberAxis.createIntegerTickUnits());
// OPTIONAL CUSTOMISATION COMPLETED.
return chart;
}
示例9: editRenderer
import org.jfree.chart.renderer.xy.XYLineAndShapeRenderer; //导入方法依赖的package包/类
/**
* Edit the parameters in the renderer
* @param i
* @param dotSize
* @param p
*/
public void editRenderer(int i, int dotSize, Paint p, boolean drawLines, boolean drawShapes){
XYLineAndShapeRenderer rend = renderers.get(i);
rend.setSeriesPaint(0, p);
rend.setSeriesShape(0, new Ellipse2D.Double(0, 0, dotSize, dotSize));
rend.setSeriesStroke(0, new BasicStroke(2));
rend.setSeriesLinesVisible(0, drawLines);
rend.setSeriesShapesVisible(0, drawShapes);
}
示例10: OrderParameterVsRandomnessChart
import org.jfree.chart.renderer.xy.XYLineAndShapeRenderer; //导入方法依赖的package包/类
public OrderParameterVsRandomnessChart( int maxItemCount ) {
this.maxItemCount = maxItemCount;
meanSeries = new XYSeries( "Raw Data" );
lineSeries = new XYSeries( "Mean Values" );
xySeriesCollection = new XYSeriesCollection( meanSeries );
xySeriesCollection.addSeries( lineSeries );
domainAxis = new NumberAxis( "Randomness" );
rangeAxis = new NumberAxis( "Order Parameter" );
renderer = new XYLineAndShapeRenderer();
int RAW_DATA_SERIES = 0;
int LINE_SERIES = 1;
renderer.setSeriesShape( RAW_DATA_SERIES, new Ellipse2D.Double( -3, -3, 6, 6 ) );
renderer.setSeriesShape( LINE_SERIES, new Rectangle( -4, -4, 8, 8 ) );
renderer.setSeriesLinesVisible( RAW_DATA_SERIES, false );
renderer.setSeriesShapesVisible( RAW_DATA_SERIES, true );
Color blue = new Color( 0, 0, 255, 14 );
renderer.setSeriesPaint( RAW_DATA_SERIES, blue );
renderer.setSeriesItemLabelPaint( RAW_DATA_SERIES, blue );
renderer.setSeriesOutlinePaint( RAW_DATA_SERIES, blue );
renderer.setSeriesLinesVisible( LINE_SERIES, true );
xyPlot = new XYPlot( xySeriesCollection,
domainAxis,
rangeAxis, renderer );
chart = new JFreeChart( "Order Parameter vs. Randomness", xyPlot );
rangeAxis.setRange( -0.01, 1.01 );
domainAxis.setAutoRange( false );
domainAxis.setRange( 0 - 0.01, Math.PI * 2 + 0.01 );
}
示例11: createFrame
import org.jfree.chart.renderer.xy.XYLineAndShapeRenderer; //导入方法依赖的package包/类
public void createFrame() {
frameName = "Histogram Data with Intervals";
chart = ChartFactory.createXYLineChart(
histName, // chart title
"Intervals (Cent)", // x axis label
"Frequency of Occurence", // y axis label
createDataset(cent,data), // data
PlotOrientation.VERTICAL,
true, // include legend
true, // tooltips
true // urls
);
plot = (XYPlot) chart.getPlot();
renderer = new XYLineAndShapeRenderer();
renderer.setSeriesLinesVisible(0, true);
renderer.setSeriesShapesVisible(0, false);
renderer.setSeriesPaint(0, Color.RED);
renderer.setSeriesPaint(1, Color.BLACK);
grids = new BasicStroke(1.0f,BasicStroke.CAP_ROUND, BasicStroke.JOIN_ROUND, 100.0f, new float[] {10f}, 1.0f);
plot.setDomainGridlinesVisible(true);
plot.setDomainGridlinePaint(Color.BLUE);
plot.setDomainGridlineStroke(grids);
plot.setRenderer(renderer);
panel = new ChartPanel(chart,true);
panel.setRangeZoomable(false);
panel.setVisible(true);
contentPanel.removeAll();
contentPanel.add(panel);
setVisible(true);
repaint();
pack();
}
示例12: createOnlyChart
import org.jfree.chart.renderer.xy.XYLineAndShapeRenderer; //导入方法依赖的package包/类
public void createOnlyChart(boolean withTemplate){
chart = ChartFactory.createXYLineChart(
histName, // chart title
"Intervals (Cent)", // x axis label
"Frequency of Occuarence", // y axis label
createDataset(cent,songData,withTemplate), // data
PlotOrientation.VERTICAL,
true, // include legend
true, // tooltips
true // urls
);
renderer = new XYLineAndShapeRenderer();
renderer.setSeriesLinesVisible(0, true);
renderer.setSeriesShapesVisible(0, false);
renderer.setSeriesPaint(0, Color.RED);
renderer.setSeriesLinesVisible(1, true);
renderer.setSeriesShapesVisible(1, false);
renderer.setSeriesPaint(1, Color.BLACK);
renderer.setSeriesLinesVisible(2, false);
renderer.setSeriesShapesVisible(2, true);
renderer.setSeriesPaint(2, Color.BLUE);
renderer.setSeriesLinesVisible(3, true);
renderer.setSeriesShapesVisible(3, false);
renderer.setSeriesPaint(3, Color.BLUE);
plot = (XYPlot) chart.getPlot();
plot.setRenderer(renderer);
}
示例13: setupChart
import org.jfree.chart.renderer.xy.XYLineAndShapeRenderer; //导入方法依赖的package包/类
private void setupChart(String pInitialId, XYDataset pInitialDataset) {
chart = ChartFactory.createTimeSeriesChart(
"Spielerstatistiken", // title
"Zeiten", // x-axis label
pInitialId, // y-axis label
pInitialDataset, // data
jShowLegend.isSelected(), // create legend?
true, // generate tooltips?
false // generate URLs?
);
chart.setBackgroundPaint(Constants.DS_BACK);
XYPlot plot = (XYPlot) chart.getPlot();
setupPlotDrawing(plot);
XYLineAndShapeRenderer renderer = new XYLineAndShapeRenderer();
for (int i = 0; i < plot.getSeriesCount(); i++) {
renderer.setSeriesLinesVisible(i, jShowLines.isSelected());
renderer.setSeriesShapesVisible(i, jShowDataPoints.isSelected());
plot.setRenderer(i, renderer);
}
renderer.setBaseItemLabelsVisible(jShowItemValues.isSelected());
renderer.setBaseItemLabelGenerator(new org.jfree.chart.labels.StandardXYItemLabelGenerator());
renderer.setBaseToolTipGenerator(new StandardXYToolTipGenerator(StandardXYToolTipGenerator.DEFAULT_TOOL_TIP_FORMAT, new SimpleDateFormat("dd.MM.yyyy HH:mm:ss"), NumberFormat.getInstance()));
int lastDataset = plot.getDatasetCount() - 1;
if (lastDataset > 0) {
plot.getRangeAxis().setAxisLinePaint(plot.getLegendItems().get(lastDataset).getLinePaint());
plot.getRangeAxis().setLabelPaint(plot.getLegendItems().get(lastDataset).getLinePaint());
plot.getRangeAxis().setTickLabelPaint(plot.getLegendItems().get(lastDataset).getLinePaint());
plot.getRangeAxis().setTickMarkPaint(plot.getLegendItems().get(lastDataset).getLinePaint());
}
NumberFormat nf = NumberFormat.getInstance();
nf.setMinimumFractionDigits(0);
nf.setMaximumFractionDigits(0);
NumberAxis na = ((NumberAxis) plot.getRangeAxis());
if (na != null) {
na.setNumberFormatOverride(nf);
}
}
示例14: addDataset
import org.jfree.chart.renderer.xy.XYLineAndShapeRenderer; //导入方法依赖的package包/类
private void addDataset(String pId, XYDataset pDataset) {
if (chart == null) {
setupChart(pId, pDataset);
} else {
XYPlot plot = (XYPlot) chart.getPlot();
plot.setDataset(plot.getDatasetCount(), pDataset);
NumberAxis axis = new NumberAxis(pId);
NumberFormat nf = NumberFormat.getInstance();
nf.setMinimumFractionDigits(0);
nf.setMaximumFractionDigits(0);
axis.setNumberFormatOverride(nf);
plot.setRangeAxis(plot.getDatasetCount() - 1, axis);
plot.setRangeAxisLocation(plot.getDatasetCount() - 1, AxisLocation.TOP_OR_LEFT);
plot.mapDatasetToRangeAxis(plot.getDatasetCount() - 1, plot.getDatasetCount() - 1);
XYLineAndShapeRenderer renderer = new XYLineAndShapeRenderer();
renderer.setSeriesLinesVisible(0, jShowLines.isSelected());
renderer.setSeriesShapesVisible(0, jShowDataPoints.isSelected());
plot.setRenderer(plot.getDatasetCount() - 1, renderer);
renderer.setBaseItemLabelsVisible(jShowItemValues.isSelected());
renderer.setBaseItemLabelGenerator(new org.jfree.chart.labels.StandardXYItemLabelGenerator());
renderer.setBaseToolTipGenerator(new StandardXYToolTipGenerator(StandardXYToolTipGenerator.DEFAULT_TOOL_TIP_FORMAT, new SimpleDateFormat("dd.MM.yyyy HH:mm:ss"), NumberFormat.getInstance()));
axis.setAxisLinePaint(plot.getLegendItems().get(plot.getDatasetCount() - 1).getLinePaint());
axis.setLabelPaint(plot.getLegendItems().get(plot.getDatasetCount() - 1).getLinePaint());
axis.setTickLabelPaint(plot.getLegendItems().get(plot.getDatasetCount() - 1).getLinePaint());
axis.setTickMarkPaint(plot.getLegendItems().get(plot.getDatasetCount() - 1).getLinePaint());
}
}
示例15: setCommaAxis
import org.jfree.chart.renderer.xy.XYLineAndShapeRenderer; //导入方法依赖的package包/类
public void setCommaAxis(){
frameName = "Histogram Data with Intervals";
chart = ChartFactory.createXYLineChart(
histName, // chart title
"Intervals (Holderian Comma)", // x axis label
"Frequency of Occurence", // y axis label
createDataset2(cent,data), // data
PlotOrientation.VERTICAL,
true, // include legend
true, // tooltips
true ); // urls
plot = (XYPlot) chart.getPlot();
renderer = new XYLineAndShapeRenderer();
renderer.setSeriesLinesVisible(0, true);
renderer.setSeriesShapesVisible(0, false);
renderer.setSeriesPaint(0, Color.RED);
renderer.setSeriesPaint(1, Color.BLACK);
grids = new BasicStroke(1.0f,BasicStroke.CAP_ROUND, BasicStroke.JOIN_ROUND, 100.0f, new float[] {10f}, 1.0f);
plot.setDomainGridlinesVisible(true);
plot.setDomainGridlinePaint(Color.BLUE);
plot.setDomainGridlineStroke(grids);
plot.setRenderer(renderer);
panel = new ChartPanel(chart,true);
panel.setRangeZoomable(false);
panel.setVisible(true);
contentPanel.removeAll();
contentPanel.add(panel);
setVisible(true);
repaint();
pack();
}