本文整理汇总了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;
}