當前位置: 首頁>>代碼示例>>Java>>正文


Java XYLineAndShapeRenderer.setDrawSeriesLineAsPath方法代碼示例

本文整理匯總了Java中org.jfree.chart.renderer.xy.XYLineAndShapeRenderer.setDrawSeriesLineAsPath方法的典型用法代碼示例。如果您正苦於以下問題:Java XYLineAndShapeRenderer.setDrawSeriesLineAsPath方法的具體用法?Java XYLineAndShapeRenderer.setDrawSeriesLineAsPath怎麽用?Java XYLineAndShapeRenderer.setDrawSeriesLineAsPath使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.jfree.chart.renderer.xy.XYLineAndShapeRenderer的用法示例。


在下文中一共展示了XYLineAndShapeRenderer.setDrawSeriesLineAsPath方法的13個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: makeChart

import org.jfree.chart.renderer.xy.XYLineAndShapeRenderer; //導入方法依賴的package包/類
public static JFreeChart makeChart(String name, String currency, XYDataset dataset, boolean isMonth) {
	String timePeriod = "Day";
	if (isMonth) {
		timePeriod = "Month";
	}
	JFreeChart chart = ChartFactory.createTimeSeriesChart(name, timePeriod, "Price in " + currency, dataset);
	XYPlot plot = (XYPlot) chart.getPlot();
	
	DateAxis axis = (DateAxis) plot.getDomainAxis();
	if (isMonth) {
     axis.setDateFormatOverride(new SimpleDateFormat("MMM-yyyy"));
	} else {
		axis.setDateFormatOverride(new SimpleDateFormat("dd-MMM-yyyy"));
	}

   XYItemRenderer r = plot.getRenderer();
   if (r instanceof XYLineAndShapeRenderer) {
     XYLineAndShapeRenderer renderer = (XYLineAndShapeRenderer) r;
     renderer.setDrawSeriesLineAsPath(true);
     renderer.setBaseShapesVisible(true);
   }
   
	return chart;
}
 
開發者ID:CSTIB-Hotel,項目名稱:OTCAnalyser,代碼行數:25,代碼來源:LineGraphMaker.java

示例2: createChart

import org.jfree.chart.renderer.xy.XYLineAndShapeRenderer; //導入方法依賴的package包/類
/**
 * Creates a chart.
 *
 * @param dataset  a dataset.
 *
 * @return A chart.
 */
private static JFreeChart createChart(XYDataset dataset) {

    JFreeChart chart = ChartFactory.createTimeSeriesChart(
        "Legal & General Unit Trust Prices",  // title
        "Date",             // x-axis label
        "Price Per Unit",   // y-axis label
        dataset,            // data
        true,               // create legend?
        true,               // generate tooltips?
        false               // generate URLs?
    );

    chart.setBackgroundPaint(Color.white);

    XYPlot plot = (XYPlot) chart.getPlot();
    plot.setBackgroundPaint(Color.lightGray);
    plot.setDomainGridlinePaint(Color.white);
    plot.setRangeGridlinePaint(Color.white);
    plot.setAxisOffset(new RectangleInsets(5.0, 5.0, 5.0, 5.0));
    plot.setDomainCrosshairVisible(true);
    plot.setRangeCrosshairVisible(true);

    XYItemRenderer r = plot.getRenderer();
    if (r instanceof XYLineAndShapeRenderer) {
        XYLineAndShapeRenderer renderer = (XYLineAndShapeRenderer) r;
        renderer.setBaseShapesVisible(true);
        renderer.setBaseShapesFilled(true);
        renderer.setDrawSeriesLineAsPath(true);
    }

    DateAxis axis = (DateAxis) plot.getDomainAxis();
    axis.setDateFormatOverride(new SimpleDateFormat("MMM-yyyy"));

    return chart;

}
 
開發者ID:Yarichi,項目名稱:Proyecto-DASI,代碼行數:44,代碼來源:TimeSeriesChartDemo1.java

示例3: 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);                       
    }
 
開發者ID:Yarichi,項目名稱:Proyecto-DASI,代碼行數:28,代碼來源:VisualizacionJfreechart.java

示例4: 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);                       
    }
 
開發者ID:Yarichi,項目名稱:Proyecto-DASI,代碼行數:29,代碼來源:VisualizacionJfreechart.java

示例5: createChart

import org.jfree.chart.renderer.xy.XYLineAndShapeRenderer; //導入方法依賴的package包/類
/**
 * Crea un objeto JFreechart con el titulo pasado por parametro con 
 * leyenda en el eje X  siendo el tiempo y la leyenda de eje Y  la velocidad.
 * La grafica creada es vacía.
 *
 * @param title. Titulo de la grafica.
 *
 * @return A chart.
 */
private  JFreeChart createChart() {

    JFreeChart chart = ChartFactory.createTimeSeriesChart(
            title, // title
            LEYENDA_X, // x-axis label
            LEYENDA_Y, // y-axis label
            dataset, // data
            true, // create legend?
            true, // generate tooltips?
            false // generate URLs?
            );

    chart.setBackgroundPaint(Color.white);

    XYPlot plot = (XYPlot) chart.getPlot();
    plot.setBackgroundPaint(Color.lightGray);
    plot.setDomainGridlinePaint(Color.white);
    plot.setRangeGridlinePaint(Color.white);
    plot.setAxisOffset(new RectangleInsets(5.0, 5.0, 5.0, 5.0));
    plot.setDomainCrosshairVisible(true);
    plot.setRangeCrosshairVisible(true);

    XYItemRenderer r = plot.getRenderer();
    if (r instanceof XYLineAndShapeRenderer) {
        XYLineAndShapeRenderer renderer = (XYLineAndShapeRenderer) r;
        renderer.setBaseShapesVisible(true);
        renderer.setBaseShapesFilled(true);
        renderer.setDrawSeriesLineAsPath(true);
    }

    DateAxis axis = (DateAxis) plot.getDomainAxis();
    axis.setDateFormatOverride(new SimpleDateFormat("h:mm"));
    chartSet = chart;
    return chart;

}
 
開發者ID:salcedonia,項目名稱:egorilla-software-engineering-2008-2009,代碼行數:46,代碼來源:PanelGrafica.java

示例6: addLabelledPeakDataset

import org.jfree.chart.renderer.xy.XYLineAndShapeRenderer; //導入方法依賴的package包/類
public synchronized void addLabelledPeakDataset(final XYDataset dataSet,
    final String label) {

// Add standard peak data set.
addPeakDataset(dataSet);

// Do we have a label?
if (label != null && label.length() > 0) {

    // Add peak label renderer and data set.
    final XYLineAndShapeRenderer renderer = new XYLineAndShapeRenderer(
	    false, false);
    renderer.setDefaultItemLabelsVisible(labelsVisible == 2);
    renderer.setDefaultItemLabelPaint(LABEL_COLOR);
    addDataSetRenderer(dataSet, renderer);
    renderer.setDrawSeriesLineAsPath(true);
    renderer.setDefaultItemLabelGenerator(new XYItemLabelGenerator() {

	@Override
	public String generateLabel(final XYDataset xyDataSet,
		final int series, final int item) {

	    return ((PeakDataSet) xyDataSet).isPeak(item) ? label
		    : null;
	}
    });

    havePeakLabels = true;
}
   }
 
開發者ID:mzmine,項目名稱:mzmine2,代碼行數:31,代碼來源:TICPlot.java

示例7: setDrawSeriesLineAsPath

import org.jfree.chart.renderer.xy.XYLineAndShapeRenderer; //導入方法依賴的package包/類
private static void setDrawSeriesLineAsPath(JFreeChart chart, boolean usePath) {

    final XYPlot plot = chart.getXYPlot();

    for (int i = 0; i < plot.getRendererCount(); i++) {
      XYItemRenderer renderer = plot.getRenderer(i);
      if (renderer instanceof XYLineAndShapeRenderer) {
        XYLineAndShapeRenderer r = (XYLineAndShapeRenderer) renderer;
        r.setDrawSeriesLineAsPath(usePath);
      }
    }
  }
 
開發者ID:mzmine,項目名稱:mzmine3,代碼行數:13,代碼來源:JFreeChartUtils.java

示例8: createChart

import org.jfree.chart.renderer.xy.XYLineAndShapeRenderer; //導入方法依賴的package包/類
/**
 * Creates a chart.
 *
 * @param dataset  a dataset.
 *
 * @return A chart.
 */
private static JFreeChart createChart(XYDataset dataset) {

    JFreeChart chart = ChartFactory.createTimeSeriesChart(
        "International Coffee Organisation : Coffee Prices",    // title
        null,             // x-axis label
        "US cents/lb",      // y-axis label
        dataset);

    String fontName = "Palatino";
    chart.getTitle().setFont(new Font(fontName, Font.BOLD, 18));
    chart.addSubtitle(new TextTitle("Source: http://www.ico.org/historical/2010-19/PDF/HIST-PRICES.pdf", new Font(fontName, Font.PLAIN, 14)));

    XYPlot plot = (XYPlot) chart.getPlot();
    plot.setDomainPannable(true);
    plot.setRangePannable(false);
    plot.setDomainCrosshairVisible(true);
    plot.setRangeCrosshairVisible(true);
    plot.getDomainAxis().setLowerMargin(0.0);
    plot.getDomainAxis().setLabelFont(new Font(fontName, Font.BOLD, 14));
    plot.getDomainAxis().setTickLabelFont(new Font(fontName, Font.PLAIN, 12));
    plot.getRangeAxis().setLabelFont(new Font(fontName, Font.BOLD, 14));
    plot.getRangeAxis().setTickLabelFont(new Font(fontName, Font.PLAIN, 12));
    chart.getLegend().setItemFont(new Font(fontName, Font.PLAIN, 14));
    chart.getLegend().setFrame(BlockBorder.NONE);
    chart.getLegend().setHorizontalAlignment(HorizontalAlignment.CENTER);
    XYItemRenderer r = plot.getRenderer();
    if (r instanceof XYLineAndShapeRenderer) {
        XYLineAndShapeRenderer renderer = (XYLineAndShapeRenderer) r;
        renderer.setDefaultShapesVisible(false);
        renderer.setDrawSeriesLineAsPath(true);
        // set the default stroke for all series
        renderer.setAutoPopulateSeriesStroke(false);
        renderer.setDefaultStroke(new BasicStroke(3.0f, 
                BasicStroke.CAP_ROUND, BasicStroke.JOIN_BEVEL), false);
        renderer.setSeriesPaint(0, Color.RED);
        renderer.setSeriesPaint(1, new Color(24, 123, 58));
        renderer.setSeriesPaint(2, new Color(149, 201, 136));
        renderer.setSeriesPaint(3, new Color(1, 62, 29));
        renderer.setSeriesPaint(4, new Color(81, 176, 86));
        renderer.setSeriesPaint(5, new Color(0, 55, 122));
        renderer.setSeriesPaint(6, new Color(0, 92, 165));
        renderer.setDefaultLegendTextFont(new Font(fontName, Font.PLAIN, 14));
    }

    return chart;

}
 
開發者ID:jfree,項目名稱:jfree-fxdemos,代碼行數:55,代碼來源:FXGraphics2DDemo1.java

示例9: createChart

import org.jfree.chart.renderer.xy.XYLineAndShapeRenderer; //導入方法依賴的package包/類
/**
 * Creates a chart.
 *
 * @param dataset  a dataset.
 *
 * @return A chart.
 */
private static JFreeChart createChart(XYDataset dataset) {

    JFreeChart chart = ChartFactory.createTimeSeriesChart(
        "International Coffee Organisation : Coffee Prices",    // title
        null,             // x-axis label
        "US cents/lb",      // y-axis label
        dataset);

    String fontName = "Palatino";
    chart.getTitle().setFont(new Font(fontName, Font.BOLD, 18));
    chart.addSubtitle(new TextTitle("Source: http://www.ico.org/historical/2010-19/PDF/HIST-PRICES.pdf", 
            new Font(fontName, Font.PLAIN, 14)));

    XYPlot plot = (XYPlot) chart.getPlot();
    plot.setDomainPannable(true);
    plot.setRangePannable(true);
    plot.setDomainCrosshairVisible(true);
    plot.setRangeCrosshairVisible(true);
    plot.getDomainAxis().setLowerMargin(0.0);
    plot.getDomainAxis().setLabelFont(new Font(fontName, Font.BOLD, 14));
    plot.getDomainAxis().setTickLabelFont(new Font(fontName, Font.PLAIN, 12));
    plot.getRangeAxis().setLabelFont(new Font(fontName, Font.BOLD, 14));
    plot.getRangeAxis().setTickLabelFont(new Font(fontName, Font.PLAIN, 12));
    chart.getLegend().setItemFont(new Font(fontName, Font.PLAIN, 14));
    chart.getLegend().setFrame(BlockBorder.NONE);
    chart.getLegend().setHorizontalAlignment(HorizontalAlignment.CENTER);
    XYItemRenderer r = plot.getRenderer();
    if (r instanceof XYLineAndShapeRenderer) {
        XYLineAndShapeRenderer renderer = (XYLineAndShapeRenderer) r;
        renderer.setDefaultShapesVisible(false);
        renderer.setDrawSeriesLineAsPath(true);
        // set the default stroke for all series
        renderer.setAutoPopulateSeriesStroke(false);
        renderer.setDefaultStroke(new BasicStroke(3.0f));
        renderer.setSeriesPaint(0, Color.RED);
        renderer.setSeriesPaint(1, new Color(24, 123, 58));
        renderer.setSeriesPaint(2, new Color(149, 201, 136));
        renderer.setSeriesPaint(3, new Color(1, 62, 29));
        renderer.setSeriesPaint(4, new Color(81, 176, 86));
        renderer.setSeriesPaint(5, new Color(0, 55, 122));
        renderer.setSeriesPaint(6, new Color(0, 92, 165));
    }

    return chart;

}
 
開發者ID:jfree,項目名稱:jfree-fxdemos,代碼行數:54,代碼來源:TimeSeriesChartFXDemo1.java

示例10: testEquals

import org.jfree.chart.renderer.xy.XYLineAndShapeRenderer; //導入方法依賴的package包/類
/**
 * Test that the equals() method distinguishes all fields.
 */
public void testEquals() {
    
    XYLineAndShapeRenderer r1 = new XYLineAndShapeRenderer();
    XYLineAndShapeRenderer r2 = new XYLineAndShapeRenderer();
    assertEquals(r1, r2);
    assertEquals(r2, r1);

    r1.setLinesVisible(true);
    assertFalse(r1.equals(r2));
    r2.setLinesVisible(true);
    assertTrue(r1.equals(r2));
    
    r1.setSeriesLinesVisible(3, true);
    assertFalse(r1.equals(r2));
    r2.setSeriesLinesVisible(3, true);
    assertTrue(r1.equals(r2));
    
    r1.setBaseLinesVisible(false);
    assertFalse(r1.equals(r2));
    r2.setBaseLinesVisible(false);
    assertTrue(r1.equals(r2));
    
    r1.setLegendLine(new Line2D.Double(1.0, 2.0, 3.0, 4.0));
    assertFalse(r1.equals(r2));
    r2.setLegendLine(new Line2D.Double(1.0, 2.0, 3.0, 4.0));
    assertTrue(r1.equals(r2));
    
    r1.setShapesVisible(true);
    assertFalse(r1.equals(r2));
    r2.setShapesVisible(true);
    assertTrue(r1.equals(r2));
    
    r1.setSeriesShapesVisible(3, true);
    assertFalse(r1.equals(r2));
    r2.setSeriesShapesVisible(3, true);
    assertTrue(r1.equals(r2));
    
    r1.setBaseShapesVisible(false);
    assertFalse(r1.equals(r2));
    r2.setBaseShapesVisible(false);
    assertTrue(r1.equals(r2));
    
    r1.setShapesFilled(true);
    assertFalse(r1.equals(r2));
    r2.setShapesFilled(true);
    assertTrue(r1.equals(r2));
    
    r1.setSeriesShapesFilled(3, true);
    assertFalse(r1.equals(r2));
    r2.setSeriesShapesFilled(3, true);
    assertTrue(r1.equals(r2));
    
    r1.setBaseShapesFilled(false);
    assertFalse(r1.equals(r2));
    r2.setBaseShapesFilled(false);
    assertTrue(r1.equals(r2));

    r1.setDrawOutlines(!r1.getDrawOutlines());
    assertFalse(r1.equals(r2));
    r2.setDrawOutlines(r1.getDrawOutlines());
    assertTrue(r1.equals(r2));

    r1.setUseOutlinePaint(true);
    assertFalse(r1.equals(r2));
    r2.setUseOutlinePaint(true);
    assertTrue(r1.equals(r2));
    
    r1.setUseFillPaint(true);
    assertFalse(r1.equals(r2));
    r2.setUseFillPaint(true);
    assertTrue(r1.equals(r2));
    
    r1.setDrawSeriesLineAsPath(true);
    assertFalse(r1.equals(r2));
    r2.setDrawSeriesLineAsPath(true);
    assertTrue(r1.equals(r2));
}
 
開發者ID:parabuild-ci,項目名稱:parabuild-ci,代碼行數:81,代碼來源:XYLineAndShapeRendererTests.java

示例11: createChart

import org.jfree.chart.renderer.xy.XYLineAndShapeRenderer; //導入方法依賴的package包/類
/**
 * Creates a chart.
 *
 * @param dataset  a dataset.
 *
 * @return A chart.
 */
private static JFreeChart createChart(XYDataset dataset) {

    JFreeChart chart = ChartFactory.createTimeSeriesChart(
        "International Coffee Organisation : Coffee Prices",    // title
        null,             // x-axis label
        "US cents/lb",      // y-axis label
        dataset);

    String fontName = "Palatino";
    chart.getTitle().setFont(new Font(fontName, Font.BOLD, 18));
    chart.addSubtitle(new TextTitle("Source: http://www.ico.org/historical/2010-19/PDF/HIST-PRICES.pdf", 
            new Font(fontName, Font.PLAIN, 14)));

    XYPlot plot = (XYPlot) chart.getPlot();
    plot.setDomainPannable(true);
    plot.setRangePannable(true);
    plot.setDomainCrosshairVisible(true);
    plot.setRangeCrosshairVisible(true);
    plot.getDomainAxis().setLowerMargin(0.0);
    plot.getDomainAxis().setLabelFont(new Font(fontName, Font.BOLD, 14));
    plot.getDomainAxis().setTickLabelFont(new Font(fontName, Font.PLAIN, 12));
    plot.getRangeAxis().setLabelFont(new Font(fontName, Font.BOLD, 14));
    plot.getRangeAxis().setTickLabelFont(new Font(fontName, Font.PLAIN, 12));
    chart.getLegend().setItemFont(new Font(fontName, Font.PLAIN, 14));
    chart.getLegend().setFrame(BlockBorder.NONE);
    chart.getLegend().setHorizontalAlignment(HorizontalAlignment.CENTER);
    XYItemRenderer r = plot.getRenderer();
    if (r instanceof XYLineAndShapeRenderer) {
        XYLineAndShapeRenderer renderer = (XYLineAndShapeRenderer) r;
        renderer.setBaseShapesVisible(false);
        renderer.setDrawSeriesLineAsPath(true);
        // set the default stroke for all series
        renderer.setAutoPopulateSeriesStroke(false);
        renderer.setBaseStroke(new BasicStroke(3.0f, BasicStroke.CAP_ROUND, 
                BasicStroke.JOIN_BEVEL), false);
        renderer.setSeriesPaint(0, Color.RED);
        renderer.setSeriesPaint(1, new Color(24, 123, 58));
        renderer.setSeriesPaint(2, new Color(149, 201, 136));
        renderer.setSeriesPaint(3, new Color(1, 62, 29));
        renderer.setSeriesPaint(4, new Color(81, 176, 86));
        renderer.setSeriesPaint(5, new Color(0, 55, 122));
        renderer.setSeriesPaint(6, new Color(0, 92, 165));
    }

    return chart;

}
 
開發者ID:mdzio,項目名稱:ccu-historian,代碼行數:55,代碼來源:TimeSeriesChartFXDemo1.java

示例12: AlignmentRansacPlot

import org.jfree.chart.renderer.xy.XYLineAndShapeRenderer; //導入方法依賴的package包/類
public AlignmentRansacPlot() {
super(null, true);

dataset = new XYSeriesCollection();
chart = ChartFactory.createXYLineChart("", null, null, dataset,
	PlotOrientation.VERTICAL, true, true, false);

chart.setBackgroundPaint(Color.white);
setChart(chart);

// title
chartTitle = chart.getTitle();
chartTitle.setMargin(5, 0, 0, 0);
chartTitle.setFont(titleFont);

// legend constructed by ChartFactory
legend = chart.getLegend();
legend.setItemFont(legendFont);
legend.setFrame(BlockBorder.NONE);

// set the plot properties
plot = chart.getXYPlot();
plot.setBackgroundPaint(Color.white);
plot.setAxisOffset(new RectangleInsets(5.0, 5.0, 5.0, 5.0));
plot.setDatasetRenderingOrder(DatasetRenderingOrder.FORWARD);

// set grid properties
plot.setDomainGridlinePaint(gridColor);
plot.setRangeGridlinePaint(gridColor);

// set crosshair (selection) properties

plot.setDomainCrosshairVisible(true);
plot.setRangeCrosshairVisible(true);
plot.setDomainCrosshairPaint(crossHairColor);
plot.setRangeCrosshairPaint(crossHairColor);
plot.setDomainCrosshairStroke(crossHairStroke);
plot.setRangeCrosshairStroke(crossHairStroke);

// set default renderer properties
XYLineAndShapeRenderer renderer = new XYLineAndShapeRenderer();
renderer.setDefaultLinesVisible(false);
renderer.setDefaultShapesVisible(true);
renderer.setSeriesShape(0, dataPointsShape);
renderer.setSeriesShape(1, dataPointsShape);
renderer.setSeriesLinesVisible(2, true);
renderer.setSeriesShapesVisible(2, false);
renderer.setSeriesPaint(0, Color.RED);
renderer.setSeriesPaint(1, Color.GRAY);
renderer.setSeriesPaint(2, Color.BLUE);
renderer.setDefaultItemLabelPaint(labelsColor);
renderer.setDrawSeriesLineAsPath(true);

plot.setRenderer(renderer);

   }
 
開發者ID:mzmine,項目名稱:mzmine2,代碼行數:57,代碼來源:AlignmentRansacPlot.java

示例13: createChart

import org.jfree.chart.renderer.xy.XYLineAndShapeRenderer; //導入方法依賴的package包/類
/**
 * Creates the chart.
 *
 * @param dataset the dataset
 * @return the j free chart
 */
private JFreeChart createChart(XYDataset dataset) {

    JFreeChart chart = ChartFactory.createTimeSeriesChart(
        title,  // title
        x_axis,             // x-axis label
        y_axis,   // y-axis label
        dataset,            // data
        true,               // create legend?
        true,               // generate tooltips?
        false               // generate URLs?
    );

    chart.setBackgroundPaint(Color.white);

    XYPlot plot = (XYPlot) chart.getPlot();
    plot.setBackgroundPaint(Color.lightGray);
    plot.setDomainGridlinePaint(Color.white);
    plot.setRangeGridlinePaint(Color.white);
    plot.setAxisOffset(new RectangleInsets(5.0, 5.0, 5.0, 5.0));
    plot.setDomainCrosshairVisible(false);
    plot.setRangeCrosshairVisible(false);

    XYItemRenderer r = plot.getRenderer();
    if (r instanceof XYLineAndShapeRenderer) {
        XYLineAndShapeRenderer renderer = (XYLineAndShapeRenderer) r;
        renderer.setBaseShapesVisible(true);
        renderer.setBaseShapesFilled(true);
        renderer.setDrawSeriesLineAsPath(true);
    }

    DateAxis axis = (DateAxis) plot.getDomainAxis();
    axis.setDateFormatOverride(new SimpleDateFormat("dd-MMM"));
    
    if(this.values2 == null) {
    	this.drawDescriptionToDataPoint(plot);
    }

    return chart;

}
 
開發者ID:mattmagic149,項目名稱:AnSoMia,代碼行數:47,代碼來源:MarketValueChart.java


注:本文中的org.jfree.chart.renderer.xy.XYLineAndShapeRenderer.setDrawSeriesLineAsPath方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。