org.jfree.chart.JFreeChart.setBorderPaint()方法的使用及代码示例

x33g5p2x  于2022-01-21 转载在 其他  
字(7.8k)|赞(0)|评价(0)|浏览(108)

本文整理了Java中org.jfree.chart.JFreeChart.setBorderPaint()方法的一些代码示例,展示了JFreeChart.setBorderPaint()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。JFreeChart.setBorderPaint()方法的具体详情如下:
包路径:org.jfree.chart.JFreeChart
类名称:JFreeChart
方法名:setBorderPaint

JFreeChart.setBorderPaint介绍

[英]Sets the paint used to draw the chart border (if visible).
[中]设置用于绘制图表边框的油漆(如果可见)。

代码示例

代码示例来源: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: mikaelhg/openblocks

public CBarGraph(String title, int seriesNum, Color background) {
  super("", SwingConstants.CENTER);
  this.chartData = new BarData(title);
  this.chart = chartData.makeChart();
  this.background = background == null ? DEFAULT_BACKGROUND : background;
  this.chart.setBackgroundPaint(this.background);
  this.chart.setBorderPaint(null);
  ImageIcon icon = new ImageIcon(chart.createBufferedImage(150, 100));
  this.setLayout(null);
  this.setIcon(icon);
  this.setBounds(0, 0, 170, 130);
}

代码示例来源:origin: mikaelhg/openblocks

public CLineGraph(String title, int seriesNum, Color background) {
  super("", SwingConstants.CENTER);
  this.chartData = new LineData(title, true, 0.0, 30.0, 0.0, 100.0, seriesNum);
  this.chart = chartData.makeChart();
  this.background = background == null ? DEFAULT_BACKGROUND : background;
  this.chart.setBackgroundPaint(this.background);
  this.chart.setBorderPaint(null);
  ImageIcon icon = new ImageIcon(chart.createBufferedImage(150, 100));
  this.setLayout(null);
  this.setIcon(icon);
  this.setBounds(0, 0, 170, 130);
}

代码示例来源:origin: senbox-org/snap-desktop

legend.setPosition(RectangleEdge.RIGHT);
legend.setMargin(new RectangleInsets(UnitType.ABSOLUTE, 0, 4, 0, 4));
chart.setBorderPaint(Color.black);
chart.setBorderVisible(true);
chart.setBackgroundPaint(Color.white);

代码示例来源:origin: bcdev/beam

legend.setPosition(RectangleEdge.RIGHT);
legend.setMargin(new RectangleInsets(UnitType.ABSOLUTE, 0, 4, 0, 4));
chart.setBorderPaint(Color.black);
chart.setBorderVisible(true);
chart.setBackgroundPaint(Color.white);

代码示例来源:origin: org.sakaiproject.sitestats/sitestats-impl

chart.setBorderPaint (parseColor ("#cccccc"));

代码示例来源: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.setBorderPaint(parseColor("#cccccc"));

代码示例来源:origin: org.sakaiproject.sitestats/sitestats-impl

chart.setBorderPaint(parseColor("#cccccc"));

代码示例来源:origin: mikaelhg/openblocks

public void clearChart() {
  if (!lock) {
    this.chart = chartData.makeChart();
    this.chart.setBackgroundPaint(this.background);
    this.chart.setBorderPaint(null);
    if (output != null) {
      JFreeChart newChart = new JFreeChart(chart.getPlot());
      newChart.getLegend().setPosition(RectangleEdge.TOP);
      newChart.getLegend().setPadding(5, 5, 5, 5);
      newChart.setBackgroundPaint(background);
      output.setChart(newChart);
      output.invalidate();
      output.repaint();
    }
  }
}

代码示例来源:origin: mikaelhg/openblocks

public void clearChart() {
  if (!lock) {
    this.chart = chartData.makeChart();
    this.chart.setBackgroundPaint(this.background);
    this.chart.setBorderPaint(null);
    if (output != null) {
      JFreeChart newChart = new JFreeChart(chart.getPlot());
      newChart.getLegend().setPosition(RectangleEdge.TOP);
      newChart.getLegend().setPadding(5, 5, 5, 5);
      newChart.setBackgroundPaint(background);
      output.setChart(newChart);
      output.invalidate();
      output.repaint();
    }
  }
}

代码示例来源:origin: mikaelhg/openblocks

public void updateDomain(String title, int seriesNum, Color background) {
  if (!lock) {
    this.chart = chartData.makeChart();
    this.background = background == null ? DEFAULT_BACKGROUND : background;
    this.chart.setBackgroundPaint(this.background);
    this.chart.setBorderPaint(null);
    if (output != null) {
      JFreeChart newChart = new JFreeChart(chart.getPlot());
      newChart.getLegend().setPosition(RectangleEdge.TOP);
      newChart.getLegend().setPadding(5, 5, 5, 5);
      newChart.setBackgroundPaint(background);
      output.setChart(newChart);
      output.invalidate();
      output.repaint();
    }
  }
}

代码示例来源:origin: jfree/eastwood

/**
 * Creates a pie chart with 3D effect.
 *
 * @return A pie chart.
 */
private static JFreeChart createPieChart3D() {
  JFreeChart chart = ChartFactory.createPieChart3D(null, null,
      false, true, false);
  chart.setBackgroundPaint(Color.white);
  chart.setBorderPaint(Color.white);
  PiePlot3D plot = (PiePlot3D) chart.getPlot();
  plot.setBackgroundPaint(null);
  plot.setInsets(RectangleInsets.ZERO_INSETS);
  plot.setDarkerSides(true);
  plot.setBaseSectionOutlinePaint(new Color(0,0,0,0));
  plot.setStartAngle(0.0);
  plot.setInteriorGap(0.10);
  plot.setLabelGenerator(null);
  plot.setOutlineVisible(false);
  plot.setLabelBackgroundPaint(Color.white);
  plot.setLabelOutlinePaint(null);
  plot.setLabelShadowPaint(null);
  plot.setLabelPadding(RectangleInsets.ZERO_INSETS);
  plot.setLabelFont(new Font("Dialog", Font.PLAIN, 12));
  plot.setLabelPaint(Color.gray);
  plot.setToolTipGenerator(new StandardPieToolTipGenerator("{2}"));
  return chart;
}

代码示例来源:origin: org.sakaiproject.sitestats/sitestats-impl

chart.setBorderPaint (parseColor ("#cccccc"));

代码示例来源:origin: mikaelhg/openblocks

public void updateDomain(String title, int seriesNum, Color background) {
  if (!lock) {
    this.chartData.setSeriesNum(seriesNum);
    this.chart = chartData.makeChart();
    this.background = background == null ? DEFAULT_BACKGROUND : background;
    this.chart.setBackgroundPaint(this.background);
    this.chart.setBorderPaint(null);
    if (output != null) {
      JFreeChart newChart = new JFreeChart(chart.getPlot());
      newChart.getLegend().setPosition(RectangleEdge.TOP);
      newChart.getLegend().setPadding(5, 5, 5, 5);
      newChart.setBackgroundPaint(background);
      output.setChart(newChart);
      output.invalidate();
      output.repaint();
    }
  }
}

代码示例来源:origin: org.jboss.seam/jboss-seam-pdf

chart.setBorderPaint(findColor(getBorderPaint()));

代码示例来源:origin: org.sakaiproject.sitestats/sitestats-impl

chart.setBorderPaint (parseColor ("#cccccc"));

代码示例来源:origin: org.sakaiproject.sitestats/sitestats-impl

chart.setBorderPaint (parseColor ("#cccccc"));

代码示例来源:origin: com.xpn.xwiki.platform/xwiki-core

jfchart.setBorderPaint(params.getColor(ChartParams.BORDER_COLOR));

代码示例来源:origin: pentaho/pentaho-platform

chart.setBackgroundImage( chartDefinition.getChartBackgroundImage() );
chart.setBorderVisible( chartDefinition.isBorderVisible() );
chart.setBorderPaint( chartDefinition.getBorderPaint() );
if ( chart.getTitle() != null ) {
 chart.getTitle().setPosition( chartDefinition.getTitlePosition() );

相关文章