當前位置: 首頁>>代碼示例>>Java>>正文


Java PiePlot.setToolTipGenerator方法代碼示例

本文整理匯總了Java中org.jfree.chart.plot.PiePlot.setToolTipGenerator方法的典型用法代碼示例。如果您正苦於以下問題:Java PiePlot.setToolTipGenerator方法的具體用法?Java PiePlot.setToolTipGenerator怎麽用?Java PiePlot.setToolTipGenerator使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.jfree.chart.plot.PiePlot的用法示例。


在下文中一共展示了PiePlot.setToolTipGenerator方法的12個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: createPieChart

import org.jfree.chart.plot.PiePlot; //導入方法依賴的package包/類
/**
 * 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</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 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 StandardPieItemLabelGenerator());
    plot.setInsets(new Insets(0, 5, 5, 5));
    if (tooltips) {
        plot.setToolTipGenerator(
            new StandardPieItemLabelGenerator(
                StandardPieItemLabelGenerator.DEFAULT_SECTION_LABEL_FORMAT
            )
        );
    }
    if (urls) {
        plot.setURLGenerator(new StandardPieURLGenerator());
    }
    return new JFreeChart(title, JFreeChart.DEFAULT_TITLE_FONT, plot, legend);

}
 
開發者ID:parabuild-ci,項目名稱:parabuild-ci,代碼行數:37,代碼來源:ChartFactory.java

示例2: createPieChart

import org.jfree.chart.plot.PiePlot; //導入方法依賴的package包/類
/**
 * 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</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 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(
                StandardPieToolTipGenerator.DEFAULT_SECTION_LABEL_FORMAT));
    }
    if (urls) {
        plot.setURLGenerator(new StandardPieURLGenerator());
    }
    return new JFreeChart(title, JFreeChart.DEFAULT_TITLE_FONT, plot, 
            legend);

}
 
開發者ID:parabuild-ci,項目名稱:parabuild-ci,代碼行數:35,代碼來源:ChartFactory.java

示例3: createPieChart

import org.jfree.chart.plot.PiePlot; //導入方法依賴的package包/類
/**
 * 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</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 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;
}
 
開發者ID:mdzio,項目名稱:ccu-historian,代碼行數:32,代碼來源:ChartFactory.java

示例4: createPieChart

import org.jfree.chart.plot.PiePlot; //導入方法依賴的package包/類
/**
 * 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;
}
 
開發者ID:jfree,項目名稱:jfreechart,代碼行數:32,代碼來源:ChartFactory.java

示例5: createPieChart

import org.jfree.chart.plot.PiePlot; //導入方法依賴的package包/類
/**
 * 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</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 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;
}
 
開發者ID:SOCR,項目名稱:HTML5_WebSite,代碼行數:35,代碼來源:ChartFactory.java

示例6: setTooltip

import org.jfree.chart.plot.PiePlot; //導入方法依賴的package包/類
private void setTooltip(JFreeChart chart) {
	Plot plot = chart.getPlot();
	if(plot instanceof PiePlot) {
		PiePlot pp = (PiePlot)plot;		
		
		pp.setToolTipGenerator(new PieToolTipGeneratorImpl(labelFormat));
		
	}
	else if(plot instanceof CategoryPlot) {
		CategoryPlot cp=(CategoryPlot) plot;
		CategoryItemRenderer renderer = cp.getRenderer();
		renderer.setBaseToolTipGenerator(new CategoryToolTipGeneratorImpl(labelFormat));
	}
	/*else if(plot instanceof XYPlot) {
		XYPlot cp=(XYPlot) plot;
		XYItemRenderer renderer = cp.getRenderer();
		renderer.setBaseToolTipGenerator(new XYToolTipGeneratorImpl(labelFormat));
	}*/
	
}
 
開發者ID:lucee,項目名稱:Lucee4,代碼行數:21,代碼來源:Chart.java

示例7: createMultiplePieChart

import org.jfree.chart.plot.PiePlot; //導入方法依賴的package包/類
/**
 * 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;

}
 
開發者ID:SpoonLabs,項目名稱:astor,代碼行數:34,代碼來源:ChartFactory.java

示例8: addChart

import org.jfree.chart.plot.PiePlot; //導入方法依賴的package包/類
/**
 * It creates a chart for the given dataset and adds the chart to the panel.
 *
 * @param dataset The dataset that will provide the values for the chart.
 */
private void addChart() {
    JFreeChart chart = ChartFactory.createPieChart(
            getTitle(), dataset, false, true, false);
    chart.addProgressListener(locker);
    PiePlot plot = (PiePlot) chart.getPlot();
    plot.setToolTipGenerator(dataset);
    
    mainPanel().add(BorderLayout.CENTER, new ChartPanel(chart));
}
 
開發者ID:vimerzhao,項目名稱:gchisto,代碼行數:15,代碼來源:BreakdownChartPanelSingle.java

示例9: makePlot

import org.jfree.chart.plot.PiePlot; //導入方法依賴的package包/類
@Override
protected Plot makePlot(final JFreeChartBuilder.PlotParameters parameters) {

    final KeyedValuesDataset tmpDataset = this.getDataset();

    final PiePlot retVal = new PiePlot(tmpDataset);

    retVal.setShadowXOffset(0);
    retVal.setShadowYOffset(0);

    retVal.setBackgroundPaint(parameters.getBackground());
    retVal.setOutlinePaint(parameters.getOutline());

    retVal.setLabelGenerator(new StandardPieSectionLabelGenerator());

    if (this.isTooltips()) {
        retVal.setToolTipGenerator(new StandardPieToolTipGenerator());
    }
    if (this.isUrls()) {
        retVal.setURLGenerator(new StandardPieURLGenerator());
    }

    for (final Entry<Comparable<?>, Paint> tmpEntry : this.getColourSet()) {
        retVal.setSectionPaint(tmpEntry.getKey(), tmpEntry.getValue());
    }

    return retVal;
}
 
開發者ID:optimatika,項目名稱:ojAlgo-extensions,代碼行數:29,代碼來源:PieChartBuilder.java

示例10: createMultiplePieChart3D

import org.jfree.chart.plot.PiePlot; //導入方法依賴的package包/類
/**
 * 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;

}
 
開發者ID:SpoonLabs,項目名稱:astor,代碼行數:44,代碼來源:ChartFactory.java

示例11: createPieChart

import org.jfree.chart.plot.PiePlot; //導入方法依賴的package包/類
public static JFreeChart createPieChart(DefaultPieDataset dataset, String title, boolean is3D) {
        JFreeChart chart = null;
        if (is3D) {
            chart = ChartFactory.createPieChart3D(title, // 圖表標題
                    dataset, // 數據集
                    true, // 是否顯示圖例
                    true, // 是否顯示工具提示
                    true // 是否生成URL
            );
        } else {
            chart = ChartFactory.createPieChart(title, // 圖表標題
                    dataset, // 數據集
                    true, // 是否顯示圖例
                    true, // 是否顯示工具提示
                    true // 是否生成URL
            );
        }
// 設置標題字體==為了防止中文亂碼:必須設置字體
        chart.setTitle(new TextTitle(title, new Font("黑體", Font.ITALIC, 22)));
// 設置圖例的字體==為了防止中文亂碼:必須設置字體
        chart.getLegend().setItemFont(new Font("黑體", Font.BOLD, 12));
// 獲取餅圖的Plot對象(實際圖表)
        PiePlot plot = (PiePlot) chart.getPlot();
// 圖形邊框顏色
        plot.setBaseSectionOutlinePaint(Color.GRAY);
// 圖形邊框粗細
        plot.setBaseSectionOutlineStroke(new BasicStroke(0.0f));
// 設置餅狀圖的繪製方向,可以按順時針方向繪製,也可以按逆時針方向繪製
        plot.setDirection(Rotation.ANTICLOCKWISE);
// 設置繪製角度(圖形旋轉角度)
        plot.setStartAngle(70);
// 設置突出顯示的數據塊
// plot.setExplodePercent("One", 0.1D);
// 設置背景色透明度
        plot.setBackgroundAlpha(0.7F);
// 設置前景色透明度
        plot.setForegroundAlpha(0.65F);
// 設置區塊標簽的字體==為了防止中文亂碼:必須設置字體
        plot.setLabelFont(new Font("宋體", Font.PLAIN, 12));
// 扇區分離顯示,對3D圖不起效
        if (is3D)
            plot.setExplodePercent(dataset.getKey(3), 0.1D);
// 圖例顯示百分比:自定義方式,{0} 表示選項, {1} 表示數值, {2} 表示所占比例 ,小數點後兩位
        plot.setLabelGenerator(new StandardPieSectionLabelGenerator(
                "{0}:{1}\r\n({2})", NumberFormat.getNumberInstance(),
                new DecimalFormat("0.00%")));
// 圖例顯示百分比
// plot.setLegendLabelGenerator(new
// StandardPieSectionLabelGenerator("{0}={1}({2})"));
// 指定顯示的餅圖為:圓形(true) 還是橢圓形(false)
        plot.setCircular(true);
// 沒有數據的時候顯示的內容
        plot.setNoDataMessage("找不到可用數據...");
// 設置鼠標懸停提示
        plot.setToolTipGenerator(new StandardPieToolTipGenerator());
// 設置熱點鏈接
// plot.setURLGenerator(new StandardPieURLGenerator("detail.jsp"));

        return chart;
    }
 
開發者ID:glameyzhou,項目名稱:scaffold,代碼行數:61,代碼來源:JFreeChartFactory.java

示例12: createPieChart

import org.jfree.chart.plot.PiePlot; //導入方法依賴的package包/類
/**
 * 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</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 createPieChart(String title, PieDataset dataset,
        boolean legend, Locale locale) {

    PiePlot plot = new PiePlot(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;

}
 
開發者ID:SpoonLabs,項目名稱:astor,代碼行數:29,代碼來源:ChartFactory.java


注:本文中的org.jfree.chart.plot.PiePlot.setToolTipGenerator方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。