本文整理匯總了Java中org.jfree.chart.renderer.xy.XYLineAndShapeRenderer.setShapesVisible方法的典型用法代碼示例。如果您正苦於以下問題:Java XYLineAndShapeRenderer.setShapesVisible方法的具體用法?Java XYLineAndShapeRenderer.setShapesVisible怎麽用?Java XYLineAndShapeRenderer.setShapesVisible使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.jfree.chart.renderer.xy.XYLineAndShapeRenderer
的用法示例。
在下文中一共展示了XYLineAndShapeRenderer.setShapesVisible方法的11個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: getPlot
import org.jfree.chart.renderer.xy.XYLineAndShapeRenderer; //導入方法依賴的package包/類
public static JFreeChart getPlot(double[] xData, double[] yData, String title, String xlabel, String ylabel)
{
XYSeriesCollection datCol = getCollection(xData, yData, "Data");
// Create the chart
JFreeChart chart = ChartFactory.createXYLineChart(title, // Title
xlabel, // X-Axis label
ylabel, // Y-Axis label
new XYSeriesCollection(), // Dataset
PlotOrientation.VERTICAL, true, // Show legend
true, true);
// Add the series
chart.getXYPlot().setDataset(0, datCol);
// Set the rendering
XYLineAndShapeRenderer rend1 = new XYLineAndShapeRenderer(true, true);
rend1.setShapesVisible(false);
chart.getXYPlot().setRenderer(0, rend1);
return chart;
}
示例2: Grafico
import org.jfree.chart.renderer.xy.XYLineAndShapeRenderer; //導入方法依賴的package包/類
public Grafico(String frametitle, String charttitle, String xlabel, String ylabel, XYSeriesCollection dataset){
JFreeChart chart = ChartFactory.createXYLineChart(charttitle, xlabel, ylabel, dataset, PlotOrientation.VERTICAL, true, true, false);
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.setShapesVisible(true);
renderer.setShapesFilled(true);
setXyplot(plot);
setChart(chart);
ChartFrame frame= new ChartFrame(frametitle,chart);
frame.pack();
frame.setVisible(true);
}
示例3: getRenderer0
import org.jfree.chart.renderer.xy.XYLineAndShapeRenderer; //導入方法依賴的package包/類
private XYLineAndShapeRenderer getRenderer0() {
// TODO Auto-generated method stub
XYLineAndShapeRenderer renderer = new XYLineAndShapeRenderer();
renderer.setShapesVisible(false);
renderer.setShapesFilled(false);
renderer.setPaint(Color.gray);
return renderer;
}
示例4: getRenderer1
import org.jfree.chart.renderer.xy.XYLineAndShapeRenderer; //導入方法依賴的package包/類
private XYLineAndShapeRenderer getRenderer1() {
// TODO Auto-generated method stub
XYLineAndShapeRenderer renderer = new XYLineAndShapeRenderer();
renderer.setPaint(Color.decode(hex_str[4]));
renderer.setShapesVisible(true);
renderer.setShapesFilled(true);
renderer.setShape(shape);
return renderer;
}
示例5: getRenderer2
import org.jfree.chart.renderer.xy.XYLineAndShapeRenderer; //導入方法依賴的package包/類
private XYLineAndShapeRenderer getRenderer2() {
// TODO Auto-generated method stub
XYLineAndShapeRenderer renderer = new XYLineAndShapeRenderer();
renderer.setStroke(new BasicStroke(stroke));
renderer.setPaint(Color.DARK_GRAY);
renderer.setShapesVisible(false);
renderer.setShapesFilled(false);
return renderer;
}
示例6: getRenderer3
import org.jfree.chart.renderer.xy.XYLineAndShapeRenderer; //導入方法依賴的package包/類
private XYLineAndShapeRenderer getRenderer3() {
// TODO Auto-generated method stub
XYLineAndShapeRenderer renderer = new XYLineAndShapeRenderer();
renderer.setStroke(new BasicStroke(stroke));
renderer.setPaint(Color.DARK_GRAY);
renderer.setShapesVisible(false);
renderer.setShapesFilled(false);
return renderer;
}
示例7: getRenderer4
import org.jfree.chart.renderer.xy.XYLineAndShapeRenderer; //導入方法依賴的package包/類
private XYItemRenderer getRenderer4() {
// TODO Auto-generated method stub
XYLineAndShapeRenderer renderer = new XYLineAndShapeRenderer();
renderer.setStroke(new BasicStroke(stroke/4));
Color c = Color.decode(hex_str[0]);
renderer.setPaint(c);
renderer.setShapesVisible(false);
renderer.setShapesFilled(false);
return renderer;
}
示例8: getRenderer5
import org.jfree.chart.renderer.xy.XYLineAndShapeRenderer; //導入方法依賴的package包/類
private XYLineAndShapeRenderer getRenderer5() {
// TODO Auto-generated method stub
XYLineAndShapeRenderer renderer = new XYLineAndShapeRenderer();
renderer.setStroke(new BasicStroke(3));
renderer.setPaint(Color.DARK_GRAY);
renderer.setShapesVisible(false);
renderer.setShapesFilled(false);
return renderer;
}
示例9: testEquals
import org.jfree.chart.renderer.xy.XYLineAndShapeRenderer; //導入方法依賴的package包/類
/**
* Problem 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.setDefaultLinesVisible(false);
assertFalse(r1.equals(r2));
r2.setDefaultLinesVisible(false);
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.setDefaultShapesVisible(false);
assertFalse(r1.equals(r2));
r2.setDefaultShapesVisible(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.setDefaultShapesFilled(false);
assertFalse(r1.equals(r2));
r2.setDefaultShapesFilled(false);
assertTrue(r1.equals(r2));
r1.setDrawOutlines(true);
assertFalse(r1.equals(r2));
r2.setDrawOutlines(true);
assertTrue(r1.equals(r2));
r1.setUseOutlinePaint(true);
assertFalse(r1.equals(r2));
r2.setUseOutlinePaint(true);
assertTrue(r1.equals(r2));
}
示例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));
}
示例11: createLineChart
import org.jfree.chart.renderer.xy.XYLineAndShapeRenderer; //導入方法依賴的package包/類
public static JFreeChart createLineChart(String chartTitle, String chartXdesc, String chartYdesc,
String periodType, int dateInterval, String timeFormat, XYDataset dataSet) {
JFreeChart chart = ChartFactory.createTimeSeriesChart(
chartTitle, chartXdesc, chartYdesc, dataSet, true, false, false
);
StandardChartTheme chartTheme = new StandardChartTheme("CN");
ChartFactory.setChartTheme(chartTheme);
//設置標題
chart.setTitle(new TextTitle(chartTitle, new Font(/*"黑體"*/fontsName, Font.ITALIC, 22)));
LegendTitle legend = chart.getLegend();
legend.setItemFont(new Font(fontsName, Font.BOLD, 12)); // 設置圖例的字體,防止中文亂z碼
XYPlot xyplot = chart.getXYPlot();
// xyplot.setBackgroundPaint(new Color(250, 250,250));
xyplot.setBackgroundPaint(Color.white);
// xyplot.setForegroundAlpha(0.65F); // 設置前景色透明度
xyplot.setForegroundAlpha(1.0F); // 設置前景色透明度
// 設置橫虛線可見
xyplot.setRangeGridlinesVisible(true);
// 虛線色彩
xyplot.setRangeGridlinePaint(Color.gray);
xyplot.getRangeAxis().setLabelFont(new Font(fontsName, Font.BOLD, 12)); // Y軸設置字體,防止中文亂碼
xyplot.getDomainAxis().setLabelFont(new Font(fontsName, Font.BOLD, 12)); // X軸設置字體,防止中文亂碼
//邊框 不顯示
xyplot.setOutlineVisible(false);
//獲得 renderer 注意這裏是XYLineAndShapeRenderer !!
XYLineAndShapeRenderer xylineandshaperenderer = (XYLineAndShapeRenderer) xyplot.getRenderer();
xylineandshaperenderer.setShapesVisible(true); //數據點可見
xylineandshaperenderer.setShapesFilled(true); //數據點被填充即不是空心點
xylineandshaperenderer.setSeriesFillPaint(0, Color.GREEN); //數據點填充為紅色
xylineandshaperenderer.setSeriesPaint(0, Color.GREEN); //折線為綠色
xylineandshaperenderer.setUseFillPaint(true); //應用
////設置Y軸間隔
NumberAxis numAxis = (NumberAxis) xyplot.getRangeAxis();
numAxis.setTickUnit(new NumberTickUnit(1));
//邊框是否顯示
//設置X軸間隔
DateAxis dateaxis = (DateAxis) xyplot.getDomainAxis();
if (periodType.equalsIgnoreCase("MONTH")) {
dateaxis.setTickUnit(new DateTickUnit(DateTickUnitType.MONTH, dateInterval));
} else if (periodType.equalsIgnoreCase("DAY")) {
dateaxis.setTickUnit(new DateTickUnit(DateTickUnitType.DAY, dateInterval));
} else if (periodType.equalsIgnoreCase("HOUR")) {
dateaxis.setTickUnit(new DateTickUnit(DateTickUnitType.HOUR, dateInterval));
}
dateaxis.setDateFormatOverride(new SimpleDateFormat(timeFormat));
return chart;
}