本文整理匯總了Java中org.jfree.chart.renderer.xy.XYLineAndShapeRenderer.setSeriesLinesVisible方法的典型用法代碼示例。如果您正苦於以下問題:Java XYLineAndShapeRenderer.setSeriesLinesVisible方法的具體用法?Java XYLineAndShapeRenderer.setSeriesLinesVisible怎麽用?Java XYLineAndShapeRenderer.setSeriesLinesVisible使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.jfree.chart.renderer.xy.XYLineAndShapeRenderer
的用法示例。
在下文中一共展示了XYLineAndShapeRenderer.setSeriesLinesVisible方法的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: TwoHistChart
import org.jfree.chart.renderer.xy.XYLineAndShapeRenderer; //導入方法依賴的package包/類
public TwoHistChart(MakamBox obj,MakamBox recObj,boolean withTemplate) throws Exception{
chartSong = obj.getHistogramChart();
chartRec = recObj.getHistogramChart();
chartSong.createOnlyChart(withTemplate);
chartRec.createOnlyChart(false);
renderer = new XYLineAndShapeRenderer();
renderer.setSeriesPaint(0, Color.BLACK);
renderer.setSeriesLinesVisible(0, true);
renderer.setSeriesShapesVisible(0, false);
renderer.setSeriesLinesVisible(1, false);
renderer.setSeriesShapesVisible(1, true);
renderer.setSeriesLinesVisible(2, false);
renderer.setSeriesShapesVisible(2, true);
renderer.setSeriesLinesVisible(3, false);
renderer.setSeriesShapesVisible(3, true);
collectionRec = chartRec.getCollection();
plot = (XYPlot) chartSong.getChart().getPlot();
plot.setDataset(1,collectionRec);
plot.setRenderer(1,renderer);
frameName = "Song Histogram & Record Histogram";
repaint();
}
示例7: 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);
}
示例8: 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);
}
示例9: 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;
}
示例10: 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);
}
示例11: 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 );
}
示例12: 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);
}
}
示例13: 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());
}
}
示例14: styleChart
import org.jfree.chart.renderer.xy.XYLineAndShapeRenderer; //導入方法依賴的package包/類
/**
* Changes various appearance settings that are common to all the trace
* charts.
*
* @param chart
* A {@link JFreeChart} for which the common trace style is to be
* applied.
* @return A {@link JFreeChart} that has the common trace style.
*/
protected JFreeChart styleChart(JFreeChart chart) {
super.styleChart(chart);
final XYPlot plot = chart.getXYPlot();
plot.setBackgroundPaint(Color.white);
plot.setRangeGridlinePaint(Color.lightGray);
renderer = new XYLineAndShapeRenderer();
plot.setDomainGridlinesVisible(true);
plot.setDomainGridlinePaint(Color.lightGray);
plot.setRenderer(renderer);
LegendItemCollection legendItems = plot.getLegendItems();
for (int i = 0; i < legendItems.getItemCount(); i++) {
int seriesIndex = legendItems.get(i).getSeriesIndex();
renderer.setSeriesLinesVisible(seriesIndex, true);
renderer.setSeriesShapesVisible(seriesIndex, true);
Color seriesColor = (Color) renderer.lookupSeriesPaint(seriesIndex);
colorPalette.add(seriesColor);
}
// Customize the domain axis
final ValueAxis domainAxis = plot.getDomainAxis();
domainAxis.setTickMarksVisible(true);
domainAxis.setAxisLineVisible(true);
domainAxis.setLowerMargin(0.0);
// Customize the range axis
final ValueAxis rangeAxis = plot.getRangeAxis();
rangeAxis.setStandardTickUnits(rangeAxis.getStandardTickUnits());
return chart;
}
示例15: createChart
import org.jfree.chart.renderer.xy.XYLineAndShapeRenderer; //導入方法依賴的package包/類
/**
* Creates a chart.
*
* @param dataset
* the data for the chart.
*
* @return a chart.
*/
private JFreeChart createChart(final XYDataset dataset) {
chart = ChartFactory.createXYLineChart(String.valueOf(channelNum), // chart title
"t", // x axis label
"v", // y axis label
dataset, // data
PlotOrientation.VERTICAL, false, // include legend
true, // tooltips
false // urls
);
chart.setBackgroundPaint(Color.white);
plot = chart.getXYPlot();
plot.setBackgroundPaint(Color.white);
plot.setDomainGridlinePaint(Color.black);
plot.setRangeGridlinePaint(Color.black);
plot.getRangeAxis().setVisible(true);
plot.getDomainAxis().setVisible(true);
final XYLineAndShapeRenderer renderer = new XYLineAndShapeRenderer();
renderer.setSeriesLinesVisible(0, true);
renderer.setSeriesShapesVisible(1, true);
plot.setRenderer(renderer);
final NumberAxis rangeAxis = (NumberAxis) plot.getRangeAxis();
rangeAxis.setStandardTickUnits(NumberAxis.createIntegerTickUnits());
return chart;
}