((PiePlot) chart1.getPlot()).setURLGenerator(new PieURLGenerator() { @Override public String generateURL(PieDataset dataset, Comparable key, int pieIndex) {
plot.setURLGenerator(new StandardPieURLGenerator());
plot.setURLGenerator(urlGenerator);
piePlot.setURLGenerator(pieURLGenerator);
private static JFreeChart createPieDatasetChart( final PieDatasetChartDefinition chartDefinition ) { // TODO Make the following accessible from the chartDefinition boolean tooltips = true; boolean urls = true; // ----------------------------------------------------------- String title = chartDefinition.getTitle(); boolean legend = chartDefinition.isLegendIncluded(); PiePlot plot = null; plot = chartDefinition.isThreeD() ? new PiePlot3D( chartDefinition ) : new PiePlot( chartDefinition ); JFreeChartEngine.updatePlot( plot, chartDefinition ); JFreeChart pieChart = new JFreeChart( title, chartDefinition.getTitleFont(), plot, legend ); TextTitle seriesTitle = new TextTitle( "Series Title", new Font( "SansSerif", Font.BOLD, 12 ) ); //$NON-NLS-1$ //$NON-NLS-2$ seriesTitle.setPosition( RectangleEdge.BOTTOM ); pieChart.setTitle( title ); pieChart.setBackgroundPaint( chartDefinition.getChartBackgroundPaint() ); if ( tooltips ) { PieToolTipGenerator tooltipGenerator = new StandardPieToolTipGenerator(); plot.setToolTipGenerator( tooltipGenerator ); } if ( urls ) { PieURLGenerator urlGenerator = new StandardPieURLGenerator(); plot.setURLGenerator( urlGenerator ); } return pieChart; }
plot.setURLGenerator(new StandardPieURLGenerator());
plot.setURLGenerator(urlGeneratorFactory.getPieUrlGenerator(otherSegmentKey));
plot.setURLGenerator(new StandardPieURLGenerator());
PieURLGenerator urlGenerator = new StandardPieURLGenerator(); PiePlot pp = (PiePlot) plot.getPieChart().getPlot(); pp.setURLGenerator(urlGenerator);
/** * Creates a pie chart with default settings. * <P> * The chart object returned by this method uses a {@link PiePlot} instance * as the plot. * * @param title the chart title ({@code null} permitted). * @param dataset the dataset for the chart ({@code null} permitted). * @param legend a flag specifying whether or not a legend is required. * @param tooltips configure chart to generate tool tips? * @param urls configure chart to generate URLs? * * @return A pie chart. */ public static JFreeChart createPieChart(String title, PieDataset dataset, boolean legend, boolean tooltips, boolean urls) { PiePlot plot = new PiePlot(dataset); plot.setLabelGenerator(new StandardPieSectionLabelGenerator()); plot.setInsets(new RectangleInsets(0.0, 5.0, 5.0, 5.0)); if (tooltips) { plot.setToolTipGenerator(new StandardPieToolTipGenerator()); } if (urls) { plot.setURLGenerator(new StandardPieURLGenerator()); } JFreeChart chart = new JFreeChart(title, JFreeChart.DEFAULT_TITLE_FONT, plot, legend); currentTheme.apply(chart); return chart; }
PieURLGenerator urlGenerator = new StandardPieURLGenerator(); PiePlot pp = (PiePlot) plot.getPieChart().getPlot(); pp.setURLGenerator(urlGenerator);
PieURLGenerator urlGenerator = new ChartPieUrlGenerator(urlExpression); plot.setURLGenerator(urlGenerator); } else { plot.setURLGenerator(null);
PieURLGenerator urlGenerator = new StandardPieURLGenerator(); PiePlot pp = (PiePlot) plot.getPieChart().getPlot(); pp.setURLGenerator(urlGenerator);
PieURLGenerator urlGenerator = new StandardPieURLGenerator(); PiePlot pp = (PiePlot) plot.getPieChart().getPlot(); pp.setURLGenerator(urlGenerator);