本文整理汇总了Java中org.jfree.chart.renderer.category.LineAndShapeRenderer.setDrawOutlines方法的典型用法代码示例。如果您正苦于以下问题:Java LineAndShapeRenderer.setDrawOutlines方法的具体用法?Java LineAndShapeRenderer.setDrawOutlines怎么用?Java LineAndShapeRenderer.setDrawOutlines使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.jfree.chart.renderer.category.LineAndShapeRenderer
的用法示例。
在下文中一共展示了LineAndShapeRenderer.setDrawOutlines方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: crearLineChartAsignRescateVict
import org.jfree.chart.renderer.category.LineAndShapeRenderer; //导入方法依赖的package包/类
public JFreeChart crearLineChartAsignRescateVict(CategoryDataset dataset) {
chartNotifAsigResc = ChartFactory.createLineChart(
"Tiempos de Notificaci�n, asiganci�n y Rescate de Victimas ", // chart title Titulo local del grafico
"Victimas Ordenadas por tiempo de rescate ", // x axis label
"Tiempo milisegundos", // y axis label
dataset, // data
PlotOrientation.VERTICAL,
true, // include legend
true, // tooltips
false // urls
);
// NOW DO SOME OPTIONAL CUSTOMISATION OF THE CHART...
ChartPanel chartPanel = new ChartPanel(chartNotifAsigResc);
// chartNotifAsigResc.setBackgroundPaint(Color.white);
CategoryPlot plot = (CategoryPlot) chartNotifAsigResc.getPlot();
// CategoryPlot plot = chartNotifAsigResc.getCategoryPlot();
// plot.setBackgroundPaint(Color.lightGray);
// plot.setDomainGridlinePaint(Color.white);
// plot.setRangeGridlinePaint(Color.white);
// NumberAxis rangeAxis = (NumberAxis) plot.getRangeAxis();
// rangeAxis.setUpperMargin(0.15);
CategoryItemRenderer renderer = plot.getRenderer();
renderer.setItemLabelGenerator(new LabelGenerator(50.0));
renderer.setItemLabelFont(new Font("Serif", Font.PLAIN, 8));
renderer.setItemLabelsVisible(true);
// CategoryPlot plot = (CategoryPlot) chartNotifAsigResc.getPlot();
LineAndShapeRenderer rendererl = (LineAndShapeRenderer) plot.getRenderer();
rendererl.setShapesVisible(true);
rendererl.setDrawOutlines(true);
rendererl.setUseFillPaint(true);
rendererl.setFillPaint(Color.white);
chartPanel.setPreferredSize(new java.awt.Dimension(500, 270));
setContentPane(chartPanel);
this.pack();
RefineryUtilities.centerFrameOnScreen(this);
this.setVisible(true);
return chartNotifAsigResc;
}
示例2: setPlotStyle
import org.jfree.chart.renderer.category.LineAndShapeRenderer; //导入方法依赖的package包/类
private void setPlotStyle(JFreeChart chart) throws ChartException {
if (chart == null)
throw new ChartException("chart未正确创建,设置图表样式时异常!");
// 获得线性图的Plot对象
CategoryPlot localCategoryPlot = (CategoryPlot)chart.getPlot();
localCategoryPlot.setBackgroundAlpha(this.getAlpha());
BasicStroke stroke = new BasicStroke();
localCategoryPlot.setRangeGridlinesVisible(true) ;//数据轴网格是否可见
localCategoryPlot.setRangeGridlinePaint(Color.black) ;//数据轴网格线条颜色
//localCategoryPlot.setRangeGridlineStroke(stroke) ;//数据轴网格线条笔触
//localCategoryPlot.setDomainGridlinesVisible(true) ;//数据轴网格是否可见
//localCategoryPlot.setDomainGridlinePaint(Color.black) ;//数据轴网格线条颜色
//localCategoryPlot.setDomainGridlineStroke(stroke);
CategoryAxis localCategoryXAxis = (CategoryAxis)localCategoryPlot.getDomainAxis();
NumberAxis localNumberYAxis = (NumberAxis)localCategoryPlot.getRangeAxis();
localCategoryXAxis.setTickLabelFont(new Font("宋体", Font.PLAIN, 12));
localCategoryXAxis.setLabelFont(new Font("宋体", Font.PLAIN, 12));
localNumberYAxis.setStandardTickUnits(NumberAxis.createIntegerTickUnits());
localNumberYAxis.setTickLabelFont(new Font("宋体", Font.PLAIN, 12));
localNumberYAxis.setLabelFont(new Font("宋体", Font.PLAIN, 12));
LineAndShapeRenderer localLineAndShapeRenderer = (LineAndShapeRenderer)localCategoryPlot.getRenderer();
//localLineAndShapeRenderer.setDrawLines(true);// 是否折线的数据点之间用线连
//localLineAndShapeRenderer.setDrawShapes(true);// 是否折线的数据点根据分类使用不同的形状
localLineAndShapeRenderer.setStroke(new BasicStroke(this.getStrok()));//这个是设置线条的粗细
if("1".equals(this.getDisplayNumber())){
localLineAndShapeRenderer.setBaseItemLabelGenerator(new StandardCategoryItemLabelGenerator());//折线上显示数字
localLineAndShapeRenderer.setBaseItemLabelsVisible(true);
}
localLineAndShapeRenderer.setBaseShapesVisible(true);
localLineAndShapeRenderer.setBaseShapesFilled(true);
localLineAndShapeRenderer.setDrawOutlines(true);
localLineAndShapeRenderer.setUseFillPaint(true);
localLineAndShapeRenderer.setBaseFillPaint(Color.white);
}
示例3: createLegend
import org.jfree.chart.renderer.category.LineAndShapeRenderer; //导入方法依赖的package包/类
protected JFreeChart createLegend(CategoryDataset dataset) {
JFreeChart chart = ChartFactory.createLineChart(
chartTitle, // chart title
domainLabel, // domain axis label
rangeLabel, // range axis label
dataset, // data
PlotOrientation.VERTICAL, // orientation
true, // include legend
true, // tooltips
false // urls
);
// NOW DO SOME OPTIONAL CUSTOMISATION OF THE CHART...
chart.setBackgroundPaint(Color.white);
CategoryPlot plot = chart.getCategoryPlot();
LineAndShapeRenderer renderer
= (LineAndShapeRenderer) plot.getRenderer();
renderer.setBaseShapesVisible(true);
renderer.setDrawOutlines(true);
// renderer.setUseFillPaint(true);
// renderer.setFillPaint(Color.white);
renderer.setLegendItemLabelGenerator(new SOCRCategorySeriesLabelGenerator());
return chart;
}
示例4: createChart
import org.jfree.chart.renderer.category.LineAndShapeRenderer; //导入方法依赖的package包/类
/**
* Creates a sample chart.
*
* @param dataset a dataset.
*
* @return The chart.
*/
protected JFreeChart createChart(CategoryDataset dataset) {
// create the chart...
JFreeChart chart = ChartFactory.createLineChart(
chartTitle, // chart title
domainLabel, // domain axis label
rangeLabel, // range axis label
dataset, // data
PlotOrientation.VERTICAL, // orientation
!legendPanelOn, // include legend
true, // tooltips
false // urls
);
chart.setBackgroundPaint(Color.white);
CategoryPlot plot = (CategoryPlot) chart.getPlot();
plot.setBackgroundPaint(Color.lightGray);
plot.setRangeGridlinePaint(Color.white);
// customise the range axis...
NumberAxis rangeAxis = (NumberAxis) plot.getRangeAxis();
rangeAxis.setStandardTickUnits(NumberAxis.createIntegerTickUnits());
// customise the renderer...
LineAndShapeRenderer renderer
= (LineAndShapeRenderer) plot.getRenderer();
renderer.setBaseShapesVisible(true);
renderer.setDrawOutlines(true);
renderer.setUseFillPaint(true);
renderer.setBaseFillPaint(Color.white);
renderer.setLegendItemLabelGenerator(new SOCRCategorySeriesLabelGenerator());
setCategorySummary(dataset);
return chart;
}
示例5: createChart
import org.jfree.chart.renderer.category.LineAndShapeRenderer; //导入方法依赖的package包/类
/**
* Creates a sample chart.
*
* @param dataset a dataset.
*
* @return The chart.
*/
protected JFreeChart createChart(CategoryDataset dataset) {
// create the chart...
JFreeChart chart = ChartFactory.createLineChart(
chartTitle, // chart title
domainLabel, // domain axis label
rangeLabel, // range axis label
dataset, // data
PlotOrientation.VERTICAL, // orientation
!legendPanelOn, // include legend
true, // tooltips
false // urls
);
chart.setBackgroundPaint(Color.white);
CategoryPlot plot = (CategoryPlot) chart.getPlot();
plot.setBackgroundPaint(Color.lightGray);
plot.setRangeGridlinePaint(Color.white);
// customise the range axis...
NumberAxis rangeAxis = (NumberAxis) plot.getRangeAxis();
rangeAxis.setStandardTickUnits(NumberAxis.createIntegerTickUnits());
// customise the renderer...
LineAndShapeRenderer renderer
= (LineAndShapeRenderer) plot.getRenderer();
renderer.setBaseShapesVisible(true);
renderer.setDrawOutlines(true);
renderer.setUseFillPaint(true);
renderer.setBaseFillPaint(Color.white);
renderer.setLegendItemLabelGenerator(new SOCRCategorySeriesLabelGenerator());
setCategorySummary(dataset);
return chart;
}
示例6: formatSeries
import org.jfree.chart.renderer.category.LineAndShapeRenderer; //导入方法依赖的package包/类
protected void formatSeries(LineAndShapeRenderer renderer) {
renderer.setBaseShapesVisible(true);
renderer.setDrawOutlines(true);
renderer.setUseFillPaint(true);
renderer.setBaseStroke(new BasicStroke(2));
int count = ((CategoryDataset) dataset).getRowCount();
ColorGenerator colors = format.getColors();
for(int i=0; i<count; i++) {
Paint color = colors.nextColor();
renderer.setSeriesPaint(i, color);
renderer.setSeriesFillPaint(i, color);
}
}
示例7: formatSeries
import org.jfree.chart.renderer.category.LineAndShapeRenderer; //导入方法依赖的package包/类
protected void formatSeries(LineAndShapeRenderer renderer) {
renderer.setBaseShapesVisible(true);
renderer.setDrawOutlines(true);
renderer.setUseFillPaint(true);
renderer.setBaseStroke(new BasicStroke(2));
int count = ((CategoryDataset) dataset).getRowCount();
ColorGenerator colors = format.getColors();
for(int i=0; i<count; i++) {
Color color = colors.nextColor();
renderer.setSeriesPaint(i, color);
renderer.setSeriesFillPaint(i, color);
}
}
示例8: linePlt
import org.jfree.chart.renderer.category.LineAndShapeRenderer; //导入方法依赖的package包/类
public linePlt(String title, String x_title, String y_title, String Categories) throws Exception{
super("");
DefaultCategoryDataset dataset = new DefaultCategoryDataset();
String[] ct = Categories.split(";");
for(String bf: ct){
// if(bf.startsWith("("))
// bf=bf.substring(1);
// if(bf.endsWith(")"))
// bf=bf.substring(0,bf.length()-1);
dataset.addValue(new Double(jc.eval("2dbl("+jc.eval(bf.substring(0,bf.indexOf(',')))+")")),
bf.substring(bf.indexOf(',')+1,bf.lastIndexOf(',')),
bf.substring(bf.lastIndexOf(',')+1));
}
if(title==null)
title = "Line Chart";
if(y_title == null)
y_title = "y";
if(x_title == null)
x_title="x";
chart = ChartFactory.createLineChart(
title,
x_title,
y_title,
dataset,
PlotOrientation.VERTICAL, // orientation
false, // include legend
true, // tooltips?
false // URLs?
);
chart.setBackgroundPaint(Color.white);
LineAndShapeRenderer renderer = (LineAndShapeRenderer)( (CategoryPlot)chart.getPlot()).getRenderer();
renderer.setShapesVisible(true);
renderer.setDrawOutlines(true);
renderer.setUseFillPaint(true);
renderer.setFillPaint(Color.white);
/*
if(space!=null){
BarRenderer renderer = (BarRenderer) ((CategoryPlot)chart.getPlot()).getRenderer();
renderer.setItemMargin(new Double(space));
}
*/
}
示例9: createChart
import org.jfree.chart.renderer.category.LineAndShapeRenderer; //导入方法依赖的package包/类
/**
* Creates a sample chart.
*
* @param dataset a dataset.
*
* @return The chart.
*/
protected JFreeChart createChart(CategoryDataset dataset) {
if(isDemo){
chartTitle = "Java Standard Class Library";
domainLabel = "Release";
rangeLabel ="Class Count";
}else chartTitle="Line Chart";
// create the chart...
JFreeChart chart = ChartFactory.createLineChart(
chartTitle, // chart title
domainLabel, // domain axis label
rangeLabel, // range axis label
dataset, // data
PlotOrientation.VERTICAL, // orientation
!legendPanelOn, // include legend
true, // tooltips
false // urls
);
if(isDemo){
chart.addSubtitle(new TextTitle("Number of Classes By Release"));
TextTitle source = new TextTitle(
"Source: Java In A Nutshell (4th Edition) "
+ "by David Flanagan (O'Reilly)"
);
source.setFont(new Font("SansSerif", Font.PLAIN, 10));
source.setPosition(RectangleEdge.BOTTOM);
source.setHorizontalAlignment(HorizontalAlignment.RIGHT);
chart.addSubtitle(source);
}else{
chart.clearSubtitles();
}
chart.setBackgroundPaint(Color.white);
CategoryPlot plot = (CategoryPlot) chart.getPlot();
plot.setBackgroundPaint(Color.lightGray);
plot.setRangeGridlinePaint(Color.white);
// customise the range axis...
NumberAxis rangeAxis = (NumberAxis) plot.getRangeAxis();
rangeAxis.setStandardTickUnits(NumberAxis.createIntegerTickUnits());
// customise the renderer...
LineAndShapeRenderer renderer
= (LineAndShapeRenderer) plot.getRenderer();
renderer.setBaseShapesVisible(true);
renderer.setDrawOutlines(true);
renderer.setUseFillPaint(true);
renderer.setBaseFillPaint(Color.white);
renderer.setLegendItemLabelGenerator(new SOCRCategorySeriesLabelGenerator());
setCategorySummary(dataset);
return chart;
}
示例10: createCategoryLineChart
import org.jfree.chart.renderer.category.LineAndShapeRenderer; //导入方法依赖的package包/类
private JFreeChart createCategoryLineChart(String title, String xLabel, String yLabel, CategoryDataset dataset) {
// create the chart...
JFreeChart chart = ChartFactory.createLineChart(
title, // chart title
xLabel, // domain axis label
yLabel, // range axis label
dataset, // data
orientation, // orientation
true, // include legend
true, // tooltips
false // urls
);
chart.setBackgroundPaint(Color.white);
CategoryPlot plot = (CategoryPlot) chart.getPlot();
plot.setBackgroundPaint(Color.lightGray);
plot.setRangeGridlinePaint(Color.white);
// customise the range axis...
NumberAxis rangeAxis = (NumberAxis) plot.getRangeAxis();
rangeAxis.setStandardTickUnits(NumberAxis.createIntegerTickUnits());
// customise the renderer...
LineAndShapeRenderer renderer
= (LineAndShapeRenderer) plot.getRenderer();
// System.out.println("lineCondition "+lineCondition);
if (lineCondition.indexOf("noshape")!=-1)
renderer.setBaseShapesVisible(false);
else renderer.setBaseShapesVisible(true);
if (lineCondition.indexOf("noline")!=-1)
renderer.setBaseLinesVisible(false);
if (lineCondition.indexOf("nofill")!=-1){
renderer.setBaseShapesFilled(false);
renderer.setBaseFillPaint(Color.white);
renderer.setDrawOutlines(true);}
else {
renderer.setBaseShapesFilled(true);
renderer.setUseFillPaint(false);
}
/*renderer.setShapesVisible(true);
renderer.setDrawOutlines(true);
renderer.setUseFillPaint(true);
renderer.setFillPaint(Color.white);*/
// renderer.setLegendItemLabelGenerator(new SOCRCategorySeriesLabelGenerator());
return chart;
}
示例11: createPlotComponent
import org.jfree.chart.renderer.category.LineAndShapeRenderer; //导入方法依赖的package包/类
private Component createPlotComponent() {
boolean legend = true;
boolean tooltips = false;
boolean urls = false;
chart = ChartFactory.createLineChart(null, null, null,
dataSet, PlotOrientation.VERTICAL, legend, tooltips, urls);
CategoryPlot plot = chart.getCategoryPlot();
plot.setBackgroundPaint(Color.GRAY);
plot.setRangeGridlinesVisible(true);
plot.setDomainGridlinesVisible(true);
plot.setRangeGridlinePaint(Color.WHITE);
plot.setDomainGridlinePaint(Color.WHITE);
NumberAxis axis = (NumberAxis) plot.getRangeAxis();
axis.setAutoRangeIncludesZero(false);
axis.setAutoRangeStickyZero(true);
renderer = plot.getRenderer();
if(renderer instanceof LineAndShapeRenderer) {
LineAndShapeRenderer lasr = (LineAndShapeRenderer) renderer;
lasr.setBaseShapesVisible(true);
lasr.setDrawOutlines(true);
lasr.setUseFillPaint(true);
lasr.setBaseStroke(new BasicStroke(2));
ColorGenerator colors = new DefaultColorGenerator();
int count = dataSet.getRowCount();
int r = 3;
Shape circle = new Ellipse2D.Float(-r, -r, 2*r, 2*r);
for(int i=0; i<count; i++) {
Paint color = colors.nextColor();
lasr.setSeriesPaint(i, color);
lasr.setSeriesFillPaint(i, color);
lasr.setSeriesShape(i, circle);
}
}
return new ChartPanel(chart);
}
示例12: createPlotComponent
import org.jfree.chart.renderer.category.LineAndShapeRenderer; //导入方法依赖的package包/类
private Component createPlotComponent() {
boolean legend = true;
boolean tooltips = false;
boolean urls = false;
chart = ChartFactory.createLineChart(null, null, null,
dataSet, PlotOrientation.VERTICAL, legend, tooltips, urls);
CategoryPlot plot = chart.getCategoryPlot();
plot.setBackgroundPaint(Color.GRAY);
plot.setRangeGridlinesVisible(true);
plot.setDomainGridlinesVisible(true);
plot.setRangeGridlinePaint(Color.WHITE);
plot.setDomainGridlinePaint(Color.WHITE);
NumberAxis axis = (NumberAxis) plot.getRangeAxis();
axis.setAutoRangeIncludesZero(false);
axis.setAutoRangeStickyZero(true);
renderer = plot.getRenderer();
if(renderer instanceof LineAndShapeRenderer) {
LineAndShapeRenderer lasr = (LineAndShapeRenderer) renderer;
lasr.setBaseShapesVisible(true);
lasr.setDrawOutlines(true);
lasr.setUseFillPaint(true);
lasr.setBaseStroke(new BasicStroke(2));
int r = 3;
Shape circle = new Ellipse2D.Float(-r, -r, 2*r, 2*r);
int count = dataSet.getRowCount();
for(int i=0; i<count; i++) {
PlotLabel label = (PlotLabel) dataSet.getRowKey(i);
boolean isLr = label.getId() >= developments;
Color color = isLr? LINK_RATIO : FACTOR;
lasr.setSeriesPaint(i, color);
lasr.setSeriesFillPaint(i, color);
lasr.setSeriesShape(i, circle);
lasr.setSeriesShapesVisible(i, !isLr);
lasr.setSeriesLinesVisible(i, isLr);
}
}
return new ChartPanel(chart);
}