Java Code Examples for org.jfree.chart.renderer.xy.XYAreaRenderer#setSeriesOutlineStroke()

The following examples show how to use org.jfree.chart.renderer.xy.XYAreaRenderer#setSeriesOutlineStroke() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: JPanelProfil.java    From Course_Generator with GNU General Public License v3.0 6 votes vote down vote up
private JFreeChart CreateChartProfil(XYDataset dataset) {
	JFreeChart chart = ChartFactory.createXYAreaChart("", "Distance", // x axis label
			"Elevation", // y axis label
			dataset, // data
			PlotOrientation.VERTICAL, false, // include legend
			true, // tooltips
			false // urls
	);

	chart.setBackgroundPaint(Color.white); // Panel background color
	XYPlot plot = chart.getXYPlot();
	plot.setBackgroundPaint(Color.white);
	plot.setDomainGridlinePaint(Color.gray);
	plot.setRangeGridlinePaint(Color.gray);

	XYAreaRenderer renderer = new XYAreaRenderer();
	renderer.setSeriesPaint(0, new Color(0x99, 0xff, 0x00));
	renderer.setOutline(true);
	renderer.setSeriesOutlineStroke(0, new BasicStroke(2.0f));
	plot.setRenderer(renderer);

	// NumberAxis rangeAxis = (NumberAxis) plot.getRangeAxis();
	// rangeAxis.setStandardTickUnits(NumberAxis.createIntegerTickUnits());

	return chart;
}
 
Example 2
Source File: frmEditCurve.java    From Course_Generator with GNU General Public License v3.0 5 votes vote down vote up
/**
 * Creates the chart
 * 
 * @param dataset Dataset to display
 * @return Return a JFreeChart object
 */
private JFreeChart CreateChartProfile(XYDataset dataset) {
	JFreeChart chart = ChartFactory.createXYAreaChart("", bundle.getString("frmEditCurve.chart.slope"), // "Slope" x
																										// axis
																										// label
			bundle.getString("frmEditCurve.chart.speed") + " ("
					+ Utils.uSpeed2String(settings.Unit, settings.isPace) + ")", // "speed" y axis label
			dataset, // data
			PlotOrientation.VERTICAL, false, // include legend
			true, // tooltips
			false // urls
	);

	chart.setBackgroundPaint(Color.white); // Panel background color
	XYPlot plot = chart.getXYPlot();
	plot.setBackgroundPaint(Color.white);
	plot.setDomainGridlinePaint(Color.gray);
	plot.setRangeGridlinePaint(Color.gray);

	// XYLineAndShapeRenderer renderer = new XYLineAndShapeRenderer();
	XYAreaRenderer renderer = new XYAreaRenderer();
	// Green (safe color)
	renderer.setSeriesPaint(0, new Color(0x99, 0xff, 0x00));
	renderer.setOutline(true);
	// Width of the outline
	renderer.setSeriesOutlineStroke(0, new BasicStroke(2.0f));
	plot.setRenderer(renderer);

	// NumberAxis rangeAxis = (NumberAxis) plot.getRangeAxis();
	// rangeAxis.setStandardTickUnits(NumberAxis.createIntegerTickUnits());

	return chart;
}
 
Example 3
Source File: FrmElevationFilter.java    From Course_Generator with GNU General Public License v3.0 4 votes vote down vote up
/**
 * Update the chart
 * 
 * @param dataset1
 * @param dataset2
 * @return
 */
private JFreeChart CreateChart(XYDataset dataset1, XYDataset dataset2) {
	JFreeChart chart = ChartFactory.createXYAreaChart("",
			// x axis label
			bundle.getString("frmElevationFilter.labelX"), // "Distance"
			// y axis label
			bundle.getString("frmElevationFilter.labelY1"), // "Elevation"
			dataset1, // data
			PlotOrientation.VERTICAL, false, // include legend
			true, // tooltips
			false // urls
	);

	// -- Background color
	chart.setBackgroundPaint(Color.white);
	chart.setAntiAlias(true);

	XYPlot plot = (XYPlot) chart.getPlot();
	plot.setBackgroundPaint(Color.white);
	plot.setDomainGridlinePaint(Color.gray);
	plot.setRangeGridlinePaint(Color.gray);
	plot.setDomainAxisLocation(AxisLocation.BOTTOM_OR_RIGHT);

	XYAreaRenderer renderer = new XYAreaRenderer();
	renderer.setSeriesPaint(0, new Color(0x99, 0xff, 0x00));
	renderer.setOutline(true);
	renderer.setSeriesOutlineStroke(0, new BasicStroke(2.0f));
	plot.setRenderer(0, renderer);

	NumberAxis rangeAxis2 = new NumberAxis("");// bundle.getString("JPanelAnalysisTimeDist.labelY2")); // "Time"
	// plot.setRangeAxis(1, rangeAxis2);
	plot.setDataset(1, dataset2);
	plot.setRangeAxis(1, rangeAxis2);
	// plot.mapDatasetToRangeAxis(1, 1);
	StandardXYItemRenderer renderer2 = new StandardXYItemRenderer();
	renderer2.setSeriesPaint(0, Color.red);
	renderer2.setSeriesStroke(0, new BasicStroke(1.0f));
	plot.setRenderer(1, renderer2);

	// -- Select the display order
	plot.setDatasetRenderingOrder(DatasetRenderingOrder.FORWARD);

	return chart;
}
 
Example 4
Source File: JPanelAnalysisSpeed.java    From Course_Generator with GNU General Public License v3.0 4 votes vote down vote up
private JFreeChart CreateChart(XYDataset dataset1, XYDataset dataset2) {
	JFreeChart chart = ChartFactory.createXYAreaChart("",
			// x axis label
			bundle.getString("JPanelAnalysisSpeed.labelX"), // "Distance",
			// y axis label
			bundle.getString("JPanelAnalysisSpeed.labelY"), // "Speed"
			dataset1, // data
			PlotOrientation.VERTICAL, false, // include legend
			true, // tooltips
			false // urls
	);

	chart.setBackgroundPaint(Color.white); // Panel background color
	chart.setAntiAlias(true);

	XYPlot plot = chart.getXYPlot();
	plot.setBackgroundPaint(Color.white);
	plot.setDomainGridlinePaint(Color.gray);
	plot.setRangeGridlinePaint(Color.gray);
	plot.setDomainAxisLocation(AxisLocation.BOTTOM_OR_RIGHT);

	XYAreaRenderer renderer = new XYAreaRenderer();
	renderer.setSeriesPaint(0, new Color(0x99, 0xff, 0x00));
	renderer.setOutline(true);
	renderer.setSeriesOutlineStroke(0, new BasicStroke(2.0f));
	plot.setRenderer(0, renderer);

	NumberAxis rangeAxis2 = new NumberAxis();
	plot.setRangeAxis(1, rangeAxis2);
	plot.setDataset(1, dataset2);
	plot.setRangeAxis(1, rangeAxis2);
	plot.mapDatasetToRangeAxis(1, 1);

	StandardXYItemRenderer renderer2 = new StandardXYItemRenderer();
	renderer2.setSeriesPaint(0, Color.red);
	plot.setRenderer(1, renderer2);

	// -- Select the display order
	plot.setDatasetRenderingOrder(DatasetRenderingOrder.FORWARD);

	return chart;
}
 
Example 5
Source File: JPanelAnalysisSpeedSlope.java    From Course_Generator with GNU General Public License v3.0 4 votes vote down vote up
private JFreeChart CreateChart(XYDataset dataset1, XYDataset dataset2) {
	JFreeChart chart = ChartFactory.createScatterPlot("",
			// x axis label
			bundle.getString("JPanelAnalysisSpeedSlope.labelX"), // "Slope",
			// y axis label
			bundle.getString("JPanelAnalysisSpeedSlope.labelY"), // "Speed",
			// data
			dataset1, PlotOrientation.VERTICAL, false, // include legend
			true, // tooltips
			false // urls
	);

	chart.setBackgroundPaint(Color.white); // Panel background color
	chart.setAntiAlias(true);

	XYPlot plot = chart.getXYPlot();
	plot.setBackgroundPaint(Color.white);
	plot.setDomainGridlinePaint(Color.gray);
	plot.setRangeGridlinePaint(Color.gray);
	plot.setDomainAxisLocation(AxisLocation.BOTTOM_OR_RIGHT);
	plot.setRangeCrosshairLockedOnData(false);

	XYDotRenderer renderer = new XYDotRenderer();
	renderer.setSeriesPaint(0, new Color(0x6B, 0xB2, 0x00));
	renderer.setDotWidth(2);
	renderer.setDotHeight(2);
	plot.setRenderer(renderer);

	NumberAxis rangeAxis2 = new NumberAxis();
	plot.setRangeAxis(1, rangeAxis2);
	plot.setDataset(1, dataset2);
	plot.setRangeAxis(1, rangeAxis2);
	plot.mapDatasetToRangeAxis(1, 1);

	XYAreaRenderer renderer2 = new XYAreaRenderer();
	renderer2.setSeriesPaint(0, new Color(0x99, 0xff, 0x00, 0x80));
	renderer2.setOutline(true);
	renderer2.setSeriesOutlinePaint(0, new Color(0x80, 0x80, 0x80, 0x80));
	renderer2.setSeriesOutlineStroke(0, new BasicStroke(2.0f));
	plot.setRenderer(1, renderer2);

	/*
	 * StandardXYItemRenderer renderer2 = new StandardXYItemRenderer();
	 * renderer2.setSeriesPaint(0, Color.red); plot.setRenderer(1, renderer2);
	 */

	// -- Select the display order
	plot.setDatasetRenderingOrder(DatasetRenderingOrder.REVERSE);

	return chart;
}
 
Example 6
Source File: JPanelAnalysisTimeDist.java    From Course_Generator with GNU General Public License v3.0 4 votes vote down vote up
private JFreeChart CreateChart(XYDataset dataset1, XYDataset dataset2) {
	JFreeChart chart = ChartFactory.createXYAreaChart("",
			// x axis label
			bundle.getString("JPanelAnalysisTimeDist.labelX"), // "Distance"
			// y axis label
			bundle.getString("JPanelAnalysisTimeDist.labelY1"), // "Elevation"
			dataset1, // data
			PlotOrientation.VERTICAL, false, // include legend
			true, // tooltips
			false // urls
	);

	// -- Background color
	chart.setBackgroundPaint(Color.white);
	chart.setAntiAlias(true);

	XYPlot plot = (XYPlot) chart.getPlot();
	plot.setBackgroundPaint(Color.white);
	plot.setDomainGridlinePaint(Color.gray);
	plot.setRangeGridlinePaint(Color.gray);
	plot.setDomainAxisLocation(AxisLocation.BOTTOM_OR_RIGHT);

	XYAreaRenderer renderer = new XYAreaRenderer();
	renderer.setSeriesPaint(0, new Color(0x99, 0xff, 0x00));
	renderer.setOutline(true);
	renderer.setSeriesOutlineStroke(0, new BasicStroke(2.0f));
	plot.setRenderer(0, renderer);

	NumberAxis rangeAxis2 = new NumberAxis(bundle.getString("JPanelAnalysisTimeDist.labelY2")); // "Time"
	plot.setRangeAxis(1, rangeAxis2);
	plot.setDataset(1, dataset2);
	plot.setRangeAxis(1, rangeAxis2);
	plot.mapDatasetToRangeAxis(1, 1);
	StandardXYItemRenderer renderer2 = new StandardXYItemRenderer();
	renderer2.setSeriesPaint(0, Color.red);
	plot.setRenderer(1, renderer2);

	// -- Select the display order
	plot.setDatasetRenderingOrder(DatasetRenderingOrder.FORWARD);

	return chart;
}
 
Example 7
Source File: JPanelAnalysisTimeTemperature.java    From Course_Generator with GNU General Public License v3.0 4 votes vote down vote up
private JFreeChart CreateChart(XYDataset dataset1, XYDataset dataset2) {
	JFreeChart chart = ChartFactory.createXYLineChart("",
			// x axis label
			bundle.getString("JPanelAnalysisTimeDist.labelX"), // "Distance"
			// y axis label
			bundle.getString("JPanelAnalysisTimeDist.labelY1"), // "Elevation"
			dataset1, // data
			PlotOrientation.VERTICAL, false, // include legend
			true, // tooltips
			false // urls
	);

	// -- Background color
	chart.setBackgroundPaint(Color.white);
	chart.setAntiAlias(true);

	XYPlot plot = (XYPlot) chart.getPlot();
	plot.setBackgroundPaint(Color.white);
	plot.setDomainGridlinePaint(Color.gray);
	plot.setRangeGridlinePaint(Color.gray);
	plot.setDomainAxisLocation(AxisLocation.BOTTOM_OR_RIGHT);

	XYAreaRenderer renderer = new XYAreaRenderer();
	renderer.setSeriesPaint(0, new Color(0x99, 0xff, 0x00));
	renderer.setOutline(true);
	renderer.setSeriesOutlineStroke(0, new BasicStroke(2.0f));
	plot.setRenderer(0, renderer);

	NumberAxis rangeAxis2 = new NumberAxis(bundle.getString("JPanelAnalysisTimeTemperature.labelY2")); // "Time"
	plot.setRangeAxis(1, rangeAxis2);
	plot.setDataset(1, dataset2);
	plot.setRangeAxis(1, rangeAxis2);
	plot.mapDatasetToRangeAxis(1, 1);
	StandardXYItemRenderer renderer2 = new StandardXYItemRenderer();
	renderer2.setSeriesPaint(0, Color.red);
	plot.setRenderer(1, renderer2);

	// -- Select the display order
	plot.setDatasetRenderingOrder(DatasetRenderingOrder.FORWARD);

	return chart;
}