use of org.jfree.chart.util.RectangleInsets in project graphcode2vec by graphcode2vec.
the class ChartFactory method createPieChart3D.
/**
* Creates a 3D pie chart using the specified dataset. The chart object
* returned by this method uses a {@link PiePlot3D} instance as the
* plot.
*
* @param title the chart title (<code>null</code> permitted).
* @param dataset the dataset for the chart (<code>null</code> permitted).
* @param legend a flag specifying whether or not a legend is required.
*
* @return A pie chart.
*/
public static JFreeChart createPieChart3D(String title, PieDataset dataset, boolean legend) {
PiePlot3D plot = new PiePlot3D(dataset);
plot.setInsets(new RectangleInsets(0.0, 5.0, 5.0, 5.0));
plot.setToolTipGenerator(new StandardPieToolTipGenerator());
JFreeChart chart = new JFreeChart(title, JFreeChart.DEFAULT_TITLE_FONT, plot, legend);
currentTheme.apply(chart);
return chart;
}
use of org.jfree.chart.util.RectangleInsets in project graphcode2vec by graphcode2vec.
the class ChartFactory method createRingChart.
/**
* Creates a ring chart with default settings.
* <P>
* The chart object returned by this method uses a {@link RingPlot}
* instance as the plot.
*
* @param title the chart title (<code>null</code> permitted).
* @param dataset the dataset for the chart (<code>null</code> permitted).
* @param legend a flag specifying whether or not a legend is required.
* @param locale the locale (<code>null</code> not permitted).
*
* @return A ring chart.
*
* @since 1.0.7
*/
public static JFreeChart createRingChart(String title, PieDataset dataset, boolean legend, Locale locale) {
RingPlot plot = new RingPlot(dataset);
plot.setLabelGenerator(new StandardPieSectionLabelGenerator(locale));
plot.setInsets(new RectangleInsets(0.0, 5.0, 5.0, 5.0));
plot.setToolTipGenerator(new StandardPieToolTipGenerator(locale));
JFreeChart chart = new JFreeChart(title, JFreeChart.DEFAULT_TITLE_FONT, plot, legend);
currentTheme.apply(chart);
return chart;
}
use of org.jfree.chart.util.RectangleInsets in project graphcode2vec by graphcode2vec.
the class ChartFactory method createPieChart3D.
/**
* Creates a 3D pie chart using the specified dataset. The chart object
* returned by this method uses a {@link PiePlot3D} instance as the
* plot.
*
* @param title the chart title (<code>null</code> permitted).
* @param dataset the dataset for the chart (<code>null</code> permitted).
* @param legend a flag specifying whether or not a legend is required.
* @param locale the locale (<code>null</code> not permitted).
*
* @return A pie chart.
*
* @since 1.0.7
*/
public static JFreeChart createPieChart3D(String title, PieDataset dataset, boolean legend, Locale locale) {
PiePlot3D plot = new PiePlot3D(dataset);
plot.setInsets(new RectangleInsets(0.0, 5.0, 5.0, 5.0));
plot.setToolTipGenerator(new StandardPieToolTipGenerator(locale));
JFreeChart chart = new JFreeChart(title, JFreeChart.DEFAULT_TITLE_FONT, plot, legend);
currentTheme.apply(chart);
return chart;
}
use of org.jfree.chart.util.RectangleInsets in project graphcode2vec by graphcode2vec.
the class CombinedDomainCategoryPlot method add.
/**
* Adds a subplot to the combined chart and sends a {@link PlotChangeEvent}
* to all registered listeners.
* <br><br>
* The domain axis for the subplot will be set to <code>null</code>. You
* must ensure that the subplot has a non-null range axis.
*
* @param subplot the subplot (<code>null</code> not permitted).
* @param weight the weight (must be >= 1).
*/
public void add(CategoryPlot subplot, int weight) {
if (subplot == null) {
throw new IllegalArgumentException("Null 'subplot' argument.");
}
if (weight < 1) {
throw new IllegalArgumentException("Require weight >= 1.");
}
subplot.setParent(this);
subplot.setWeight(weight);
subplot.setInsets(new RectangleInsets(0.0, 0.0, 0.0, 0.0));
subplot.setDomainAxis(null);
subplot.setOrientation(getOrientation());
subplot.addChangeListener(this);
this.subplots.add(subplot);
CategoryAxis axis = getDomainAxis();
if (axis != null) {
axis.configure();
}
fireChangeEvent();
}
use of org.jfree.chart.util.RectangleInsets in project graphcode2vec by graphcode2vec.
the class CombinedDomainXYPlot method add.
/**
* Adds a subplot with the specified weight and sends a
* {@link PlotChangeEvent} to all registered listeners. The weight
* determines how much space is allocated to the subplot relative to all
* the other subplots.
* <P>
* The domain axis for the subplot will be set to <code>null</code>. You
* must ensure that the subplot has a non-null range axis.
*
* @param subplot the subplot (<code>null</code> not permitted).
* @param weight the weight (must be >= 1).
*/
public void add(XYPlot subplot, int weight) {
if (subplot == null) {
throw new IllegalArgumentException("Null 'subplot' argument.");
}
if (weight <= 0) {
throw new IllegalArgumentException("Require weight >= 1.");
}
// store the plot and its weight
subplot.setParent(this);
subplot.setWeight(weight);
subplot.setInsets(new RectangleInsets(0.0, 0.0, 0.0, 0.0), false);
subplot.setDomainAxis(null);
subplot.addChangeListener(this);
this.subplots.add(subplot);
ValueAxis axis = getDomainAxis();
if (axis != null) {
axis.configure();
}
fireChangeEvent();
}
Aggregations