本文整理了Java中org.jfree.chart.JFreeChart.setBorderVisible()
方法的一些代码示例,展示了JFreeChart.setBorderVisible()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。JFreeChart.setBorderVisible()
方法的具体详情如下:
包路径:org.jfree.chart.JFreeChart
类名称:JFreeChart
方法名:setBorderVisible
[英]Sets a flag that controls whether or not a border is drawn around the outside of the chart.
[中]设置一个标志,用于控制是否在图表外部绘制边框。
代码示例来源:origin: loklak/loklak_server
public JFreeChart getChart(JSONObject jsonData, boolean legendBit, boolean tooltipBit) {
DefaultPieDataset dataset = new DefaultPieDataset();
Iterator iter = jsonData.keys();
while (iter.hasNext()) {
String keyData = (String)iter.next();
Float value = Float.parseFloat(jsonData.getString(keyData));
dataset.setValue(keyData, value);
}
boolean legend = legendBit;
boolean tooltips = tooltipBit;
boolean urls = false;
JFreeChart chart = ChartFactory.createPieChart("Loklak Visualizes - PieChart", dataset, legend, tooltips, urls);
chart.setBorderPaint(Color.BLACK);
chart.setBorderStroke(new BasicStroke(5.0f));
chart.setBorderVisible(true);
return chart;
}
}
代码示例来源:origin: ch.epfl.gsn/gsn-core
public void initialize ( ) {
if ( !ready ) {
chart = ChartFactory.createTimeSeriesChart( plotTitle , "Time" , verticalAxisTitle , dataCollectionForTheChart , true , true , false );
chart.setBorderVisible( true );
ready = true;
logger.debug( "The Chart Virtual Sensor is ready." );
}
}
代码示例来源:origin: com.atlassian.jira/jira-core
public ChartHelper generateChart()
{
boolean legend = false;
boolean tooltips = false;
boolean urls = false;
JFreeChart chart = ChartFactory.createHistogram(null, null, yLabel, dataset, PlotOrientation.VERTICAL, legend, tooltips, urls);
setHistogramChartDefaults(chart, i18nBean);
chart.setBorderVisible(false);
return new ChartHelper(chart);
}
代码示例来源:origin: org.codehaus.sonar/sonar-deprecated
private void improveChart(JFreeChart jfrechart, ChartParameters params) {
Color background = Color.decode("#" + params.getValue(ChartParameters.PARAM_BACKGROUND_COLOR, "FFFFFF", false));
jfrechart.setBackgroundPaint(background);
jfrechart.setBorderVisible(false);
jfrechart.setAntiAlias(true);
jfrechart.setTextAntiAlias(true);
jfrechart.removeLegend();
}
代码示例来源:origin: com.atlassian.jira.plugins/jira-fisheye-plugin
public static ChartHelper generateTimeSeriesChart(XYDataset dataset, String chartTitle, String yLabel, String xLabel, List domainMarkers)
{
boolean legend = false;
boolean tooltips = true;
boolean urls = true;
JFreeChart chart = ChartFactory.createTimeSeriesChart(null, yLabel, xLabel, dataset, legend, tooltips, urls);
chart.setBackgroundPaint(Color.WHITE);
chart.setBorderVisible(false);
XYPlot plot = chart.getXYPlot();
NumberAxis yAxis = (NumberAxis) plot.getRangeAxis();
TickUnitSource units = NumberAxis.createIntegerTickUnits();
yAxis.setStandardTickUnits(units);
if (domainMarkers != null && !domainMarkers.isEmpty())
{
for (Iterator iterator = domainMarkers.iterator(); iterator.hasNext();)
{
ValueMarker valueMarker = (ValueMarker) iterator.next();
valueMarker.setLabelAnchor(RectangleAnchor.TOP_LEFT);
valueMarker.setLabelTextAnchor(TextAnchor.TOP_RIGHT);
plot.addDomainMarker(valueMarker);
}
}
XYDifferenceRenderer xyDifferenceRenderer = new XYDifferenceRenderer(COLOR_RED_PAINT, COLOR_GREEN_PAINT, true);
xyDifferenceRenderer.setSeriesPaint(0, new Color(255, 0, 0));
xyDifferenceRenderer.setSeriesPaint(1, new Color(51, 204, 51));
xyDifferenceRenderer.setShape(new Ellipse2D.Double(-1.5, -1.5, 3.0, 3.0));
plot.setRenderer(xyDifferenceRenderer);
return new ChartHelper(chart);
}
代码示例来源:origin: bcdev/beam
legend.setMargin(new RectangleInsets(UnitType.ABSOLUTE, 0, 4, 0, 4));
chart.setBorderPaint(Color.black);
chart.setBorderVisible(true);
chart.setBackgroundPaint(Color.white);
代码示例来源:origin: senbox-org/snap-desktop
legend.setMargin(new RectangleInsets(UnitType.ABSOLUTE, 0, 4, 0, 4));
chart.setBorderPaint(Color.black);
chart.setBorderVisible(true);
chart.setBackgroundPaint(Color.white);
代码示例来源:origin: com.atlassian.jira.plugins/jira-fisheye-plugin
public static ChartHelper generateMultiLineChart(XYDataset dataset, String chartTitle, String yLabel, String xLabel, List domainMarkers)
{
boolean legend = true;
boolean tooltips = true;
boolean urls = true;
JFreeChart chart = ChartFactory.createTimeSeriesChart(chartTitle, yLabel, xLabel, dataset, legend, tooltips, urls);
chart.setBackgroundPaint(Color.WHITE);
chart.setBorderVisible(false);
XYPlot plot = chart.getXYPlot();
NumberAxis yAxis = (NumberAxis) plot.getRangeAxis();
TickUnitSource units = NumberAxis.createIntegerTickUnits();
yAxis.setStandardTickUnits(units);
if (domainMarkers != null && !domainMarkers.isEmpty())
{
for (Iterator iterator = domainMarkers.iterator(); iterator.hasNext();)
{
ValueMarker valueMarker = (ValueMarker) iterator.next();
valueMarker.setLabelAnchor(RectangleAnchor.TOP_LEFT);
valueMarker.setLabelTextAnchor(TextAnchor.TOP_RIGHT);
plot.addDomainMarker(valueMarker);
}
}
XYItemRenderer plotRenderer = plot.getRenderer();
if (plotRenderer instanceof XYLineAndShapeRenderer) {
XYLineAndShapeRenderer renderer = (XYLineAndShapeRenderer) plotRenderer;
renderer.setBaseShapesVisible(true);
renderer.setBaseShapesFilled(true);
}
return new ChartHelper(chart);
}
代码示例来源:origin: com.atlassian.jira.plugins/jira-fisheye-plugin
/**
* Generates an area chart from the incoming dataset and stores the image for viewing.
*
* @param dataset is a jfreechart collection containing the issues in a form that the
* charting tool understands.
* @param chartTitle identifies the title to be used on the generated chart.
* @param yLabel identifies the label to use on the generated charts y-axis.
* @param xLabel identifies the label to use on the generated charts x-axis.
* @return a string containing the filename of the generated chart.
*/
public static ChartHelper generateAreaChart(CategoryDataset dataset, String chartTitle, String yLabel, String xLabel)
{
boolean legend = false;
boolean tooltips = false;
boolean urls = false;
JFreeChart chart = ChartFactory.createAreaChart(chartTitle, yLabel, xLabel, dataset, PlotOrientation.VERTICAL, legend, tooltips, urls);
chart.setBackgroundPaint(Color.WHITE);
chart.setBorderVisible(false);
CategoryPlot plot = chart.getCategoryPlot();
NumberAxis axis = (NumberAxis) plot.getRangeAxis();
TickUnitSource units = NumberAxis.createIntegerTickUnits();
axis.setStandardTickUnits(units);
AreaRenderer renderer = (AreaRenderer) plot.getRenderer();
renderer.setSeriesPaint(0, COLOR_RED_PAINT);
renderer.setSeriesOutlinePaint(0, new Color(255, 0, 0));
renderer.setSeriesOutlineStroke(0, new BasicStroke(1f));
renderer.setSeriesStroke(0, new BasicStroke(3f));
return new ChartHelper(chart);
}
代码示例来源:origin: com.atlassian.confluence.extra.chart/chart-plugin
public static void setDefaults(JFreeChart chart)
{
chart.setBackgroundPaint(ChartDefaults.transparent);
chart.setBorderVisible(false);
chart.getPlot().setNoDataMessage("No Data Available");
setupPlot(chart.getPlot());
ChartUtil.setupTextTitle(chart.getTitle());
ChartUtil.setupLegendTitle(chart.getLegend());
}
代码示例来源:origin: com.atlassian.jira/jira-api
public static void setDefaults(JFreeChart chart, final I18nHelper i18nHelper)
{
chart.setBackgroundPaint(Color.WHITE);
chart.setBorderVisible(false);
chart.getPlot().setNoDataMessage(i18nHelper.getText("gadget.charts.no.data"));
setupPlot(chart.getPlot());
ChartUtil.setupTextTitle(chart.getTitle());
ChartUtil.setupLegendTitle(chart.getLegend());
}
代码示例来源:origin: Baralga/baralga
/**
* Set up GUI components.
*/
private void initialize() {
hoursByProjectDataset = new DefaultPieDataset();
initChartData();
final JFreeChart chart = ChartFactory.createPieChart3D(null, hoursByProjectDataset, false, true, false);
chart.setBorderVisible(false);
chart.setAntiAlias(true);
final ChartPanel chartPanel = new ChartPanel(chart);
chartPanel.setMouseZoomable(false);
chartPanel.setEnabled(false);
chartPanel.setPopupMenu(null);
this.add(chartPanel, BorderLayout.CENTER);
}
代码示例来源:origin: org.sakaiproject.sitestats/sitestats-impl
private byte[] generateBoxAndWhiskerChart (BoxAndWhiskerCategoryDataset dataset, int width, int height)
{
JFreeChart chart = ChartFactory.createBoxAndWhiskerChart (null, null,
null, dataset, false);
// set background
chart.setBackgroundPaint (parseColor (statsManager.getChartBackgroundColor ()));
// set chart border
chart.setPadding (new RectangleInsets (10, 5, 5, 5));
chart.setBorderVisible (true);
chart.setBorderPaint (parseColor ("#cccccc"));
// set anti alias
chart.setAntiAlias (true);
CategoryPlot plot = (CategoryPlot) chart.getPlot ();
plot.setDomainGridlinePaint (Color.white);
plot.setDomainGridlinesVisible (true);
plot.setRangeGridlinePaint (Color.white);
NumberAxis rangeAxis = (NumberAxis) plot.getRangeAxis ();
rangeAxis.setStandardTickUnits (NumberAxis.createIntegerTickUnits ());
CategoryAxis domainAxis = (CategoryAxis) plot.getDomainAxis ();
domainAxis.setLowerMargin (0.0);
domainAxis.setUpperMargin (0.0);
BufferedImage img = chart.createBufferedImage (width, height);
final ByteArrayOutputStream out = new ByteArrayOutputStream();
try{
ImageIO.write(img, "png", out);
}catch(IOException e){
log.warn("Error occurred while generating SiteStats chart image data", e);
}
return out.toByteArray();
}
代码示例来源:origin: org.sakaiproject.sitestats/sitestats-impl
chart.setBorderVisible(true);
chart.setBorderPaint(parseColor("#cccccc"));
代码示例来源:origin: com.atlassian.jira.plugins/jira-fisheye-plugin
public static ChartHelper generatePieChart(PieDataset dataset, String chartTitle, Color[][] colorScheme) {
boolean legend = false;
boolean tooltips = false;
boolean urls = false;
JFreeChart chart = ChartFactory.createPieChart(chartTitle, dataset, legend, tooltips, urls);
chart.setBackgroundPaint(Color.white);
chart.setBorderVisible(false);
PiePlot plot = (PiePlot) chart.getPlot();
// Make section labels in the format "<Key>"
plot.setLabelGenerator(new StandardPieSectionLabelGenerator("{0}"));
plot.setBackgroundPaint(Color.white);
plot.setOutlinePaint(null);
for(int i = 0; i < colorScheme.length; i++)
{
setSectionColor(dataset, plot, i, colorScheme[i][0], colorScheme[i][1]);
}
plot.setShadowXOffset(0);
plot.setShadowYOffset(0);
return new ChartHelper(chart);
}
代码示例来源:origin: com.atlassian.jira.plugins/jira-fisheye-plugin
/**
* Generates a bar chart from the incoming data set and stores the image for viewing.
*
* @param dataset is a jfreechart collection containing the issues in a form that the
* charting tool understands.
* @param chartTitle identifies the title to be used on the generated chart.
* @param yLabel identifies the label to use on the generated charts y-axis.
* @param xLabel identifies the label to use on the generated charts x-axis.
* @return a string containing the filename of the generated chart.
*/
public static ChartHelper generateBarChart(CategoryDataset dataset, String chartTitle, String yLabel, String xLabel)
{
boolean legend = false;
boolean tooltips = false;
boolean urls = false;
JFreeChart chart = ChartFactory.createBarChart(chartTitle, yLabel, xLabel, dataset, PlotOrientation.VERTICAL, legend, tooltips, urls);
chart.setBackgroundPaint(Color.WHITE);
chart.setBorderVisible(false);
CategoryPlot plot = chart.getCategoryPlot();
NumberAxis axis = (NumberAxis) plot.getRangeAxis();
TickUnitSource units = NumberAxis.createIntegerTickUnits();
axis.setStandardTickUnits(units);
plot.getRenderer().setSeriesOutlinePaint(0, COLOR_GREEN_OUTLINE);
plot.getRenderer().setSeriesPaint(0, COLOR_GREEN_PAINT);
return new ChartHelper(chart);
}
代码示例来源:origin: org.jboss.seam/jboss-seam-pdf
chart.setBorderVisible(getBorderVisible());
代码示例来源:origin: com.atlassian.jira.plugins/jira-fisheye-plugin
public static ChartHelper generateStackedBarChart(CategoryDataset dataset, String chartTitle, String yLabel, String xLabel, List domainMarkers)
{
boolean legend = false;
boolean tooltips = false;
boolean urls = false;
JFreeChart chart = ChartFactory.createStackedBarChart(chartTitle, yLabel, xLabel, dataset, PlotOrientation.VERTICAL, legend, tooltips, urls);
chart.setBackgroundPaint(Color.WHITE);
chart.setBorderVisible(false);
CategoryPlot plot = chart.getCategoryPlot();
NumberAxis axis = (NumberAxis) plot.getRangeAxis();
TickUnitSource units = NumberAxis.createIntegerTickUnits();
axis.setStandardTickUnits(units);
plot.getRenderer().setSeriesOutlinePaint(1, COLOR_YELLOW_OUTLINE);
plot.getRenderer().setSeriesPaint(1, COLOR_YELLOW_PAINT);
plot.getRenderer().setSeriesOutlinePaint(0, COLOR_CYAN_OUTLINE);
plot.getRenderer().setSeriesPaint(0, COLOR_CYAN_PAINT);
return new ChartHelper(chart);
}
代码示例来源:origin: com.xpn.xwiki.platform/xwiki-core
&& params.getBoolean(ChartParams.BORDER_VISIBLE).booleanValue())
jfchart.setBorderVisible(true);
if (params.get(ChartParams.BORDER_COLOR) != null) {
jfchart.setBorderPaint(params.getColor(ChartParams.BORDER_COLOR));
代码示例来源:origin: com.atlassian.jira/jira-core
chart.setBorderVisible(false);
内容来源于网络,如有侵权,请联系作者删除!