/** * Creates a chart that displays multiple pie plots. The chart object * returned by this method uses a {@link MultiplePiePlot} instance as the * plot. * * @param title the chart title (<code>null</code> permitted). * @param dataset the dataset (<code>null</code> permitted). * @param order the order that the data is extracted (by row or by column) * (<code>null</code> not permitted). * @param legend include a legend? * * @return A chart. */ public static JFreeChart createMultiplePieChart(String title, CategoryDataset dataset, TableOrder order, boolean legend) { if (order == null) { throw new IllegalArgumentException("Null 'order' argument."); } MultiplePiePlot plot = new MultiplePiePlot(dataset); plot.setDataExtractOrder(order); plot.setBackgroundPaint(null); plot.setOutlineStroke(null); PieToolTipGenerator tooltipGenerator = new StandardPieToolTipGenerator(); PiePlot pp = (PiePlot) plot.getPieChart().getPlot(); pp.setToolTipGenerator(tooltipGenerator); JFreeChart chart = new JFreeChart(title, JFreeChart.DEFAULT_TITLE_FONT, plot, legend); currentTheme.apply(chart); return chart; }
/** * Creates a chart that displays multiple pie plots. The chart object * returned by this method uses a {@link MultiplePiePlot} instance as the * plot. * * @param title the chart title (<code>null</code> permitted). * @param dataset the dataset (<code>null</code> permitted). * @param order the order that the data is extracted (by row or by column) * (<code>null</code> not permitted). * @param legend include a legend? * * @return A chart. */ public static JFreeChart createMultiplePieChart3D(String title, CategoryDataset dataset, TableOrder order, boolean legend) { if (order == null) { throw new IllegalArgumentException("Null 'order' argument."); } MultiplePiePlot plot = new MultiplePiePlot(dataset); plot.setDataExtractOrder(order); plot.setBackgroundPaint(null); plot.setOutlineStroke(null); JFreeChart pieChart = new JFreeChart(new PiePlot3D(null)); TextTitle seriesTitle = new TextTitle("Series Title", new Font("Tahoma", Font.BOLD, 12)); seriesTitle.setPosition(RectangleEdge.BOTTOM); pieChart.setTitle(seriesTitle); pieChart.removeLegend(); pieChart.setBackgroundPaint(null); plot.setPieChart(pieChart); PieToolTipGenerator tooltipGenerator = new StandardPieToolTipGenerator(); PiePlot pp = (PiePlot) plot.getPieChart().getPlot(); pp.setToolTipGenerator(tooltipGenerator); JFreeChart chart = new JFreeChart(title, JFreeChart.DEFAULT_TITLE_FONT, plot, legend); currentTheme.apply(chart); return chart; }
/** * Returns the tool tip generator, an object that is responsible for generating the text items * used for tool tips by the plot. If the generator is <code>null</code>, no tool tips will be * created. * * @return The generator (possibly <code>null</code>). */ public PieToolTipGenerator getToolTipGenerator() { return this.toolTipGenerator; }
/** * Sets the tool tip generator and sends a {@link PlotChangeEvent} to all registered listeners. * Set the generator to <code>null</code> if you don't want any tool tips. * * @param generator the generator (<code>null</code> permitted). */ public void setToolTipGenerator(PieToolTipGenerator generator) { this.toolTipGenerator = generator; notifyListeners(new PlotChangeEvent(this)); }
/** * Returns the tool tip generator, an object that is responsible for * generating the text items used for tool tips by the plot. If the * generator is <code>null</code>, no tool tips will be created. * * @return The generator (possibly <code>null</code>). * * @see #setToolTipGenerator(PieToolTipGenerator) */ public PieToolTipGenerator getToolTipGenerator() { return this.toolTipGenerator; }
/** * Sets the tool tip generator and sends a {@link PlotChangeEvent} to all * registered listeners. Set the generator to <code>null</code> if you * don't want any tool tips. * * @param generator the generator (<code>null</code> permitted). * * @see #getToolTipGenerator() */ public void setToolTipGenerator(PieToolTipGenerator generator) { this.toolTipGenerator = generator; notifyListeners(new PlotChangeEvent(this)); }
/** * Sets the tool tip generator and sends a {@link PlotChangeEvent} to all * registered listeners. Set the generator to <code>null</code> if you * don't want any tool tips. * * @param generator the generator (<code>null</code> permitted). * * @see #getToolTipGenerator() */ public void setToolTipGenerator(PieToolTipGenerator generator) { this.toolTipGenerator = generator; fireChangeEvent(); }
/** * Returns the tool tip generator, an object that is responsible for * generating the text items used for tool tips by the plot. If the * generator is {@code null}, no tool tips will be created. * * @return The generator (possibly {@code null}). * * @see #setToolTipGenerator(PieToolTipGenerator) */ public PieToolTipGenerator getToolTipGenerator() { return this.toolTipGenerator; }
/** * Sets the tool tip generator and sends a {@link PlotChangeEvent} to all * registered listeners. Set the generator to {@code null} if you * don't want any tool tips. * * @param generator the generator ({@code null} permitted). * * @see #getToolTipGenerator() */ public void setToolTipGenerator(PieToolTipGenerator generator) { this.toolTipGenerator = generator; fireChangeEvent(); }