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


Java XYLineAndShapeRenderer.setToolTipGenerator方法代碼示例

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


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

示例1: createChart

import org.jfree.chart.renderer.xy.XYLineAndShapeRenderer; //導入方法依賴的package包/類
/**
 * Creates a sample chart.
 *
 * @param dataset a dataset for the chart.
 * @return A sample chart.
 */
private static JFreeChart createChart( XYDataset dataset ) {
    JFreeChart chart = ChartFactory.createXYLineChart(
            "XYLineAndShapeRenderer Demo 1",
            "X",
            "Y",
            dataset,
            PlotOrientation.VERTICAL,
            true,
            true,
            false
    );
    XYPlot plot = (XYPlot)chart.getPlot();
    XYLineAndShapeRenderer renderer = new XYLineAndShapeRenderer();
    renderer.setSeriesLinesVisible( 0, true );
    renderer.setSeriesShapesVisible( 0, false );
    renderer.setSeriesLinesVisible( 1, true );
    renderer.setSeriesShapesVisible( 1, false );
    renderer.setToolTipGenerator( new StandardXYToolTipGenerator() );
    renderer.setDefaultEntityRadius( 6 );
    plot.setRenderer( renderer );
    return chart;
}
 
開發者ID:mleoking,項目名稱:PhET,代碼行數:29,代碼來源:XYLineAndShapeRendererDemo1.java

示例2: StripChart

import org.jfree.chart.renderer.xy.XYLineAndShapeRenderer; //導入方法依賴的package包/類
/**
 * @param title
 * @param seriesNames
 * @param xAxisLabel
 * @param yAxisLabel
 * @param orienation
 * @param xAxisRange
 * @param minY
 * @param maxY
 * @param buffSize
 */
public StripChart( String title,
                   String[] seriesNames,
                   String xAxisLabel,
                   String yAxisLabel,
                   PlotOrientation orienation,
                   double xAxisRange,
                   double minY,
                   double maxY,
                   int buffSize ) {
    this.xAxisRange = xAxisRange;
    this.buffSize = buffSize;
    buffTail = buffSize - 1;

    series = new XYSeries[seriesNames.length];
    buffer = new double[seriesNames.length + 1][buffSize];
    clockBufferIdx = seriesNames.length;
    XYSeriesCollection dataset = new XYSeriesCollection();
    for( int i = 0; i < series.length; i++ ) {
        series[i] = new XYSeries( seriesNames[i] );
        dataset.addSeries( series[i] );
    }

    chart = ChartFactory.createXYLineChart(
            title,
            xAxisLabel,
            yAxisLabel,
            dataset,
            orienation,
            true,
            true,
            false
    );
    chart.getXYPlot().setDomainGridlinesVisible( false );
    chart.getXYPlot().setRangeGridlinesVisible( false );
    chart.getLegend().setHorizontalAlignment( HorizontalAlignment.RIGHT );
    plot = (XYPlot)chart.getPlot();
    plot.getRangeAxis().setRange( minY, maxY );

    renderer = new XYLineAndShapeRenderer();
    for( int i = 0; i < series.length; i++ ) {
        renderer.setSeriesLinesVisible( i, true );
        renderer.setSeriesShapesVisible( i, false );
    }
    renderer.setSeriesLinesVisible( series.length, false );
    renderer.setSeriesShapesVisible( series.length, false );
    renderer.setToolTipGenerator( new StandardXYToolTipGenerator() );
    renderer.setDefaultEntityRadius( 6 );
    plot.setRenderer( renderer );

    // Set the minimum X value. This also sets the x range
    setMinX( 0 );
}
 
開發者ID:mleoking,項目名稱:PhET,代碼行數:64,代碼來源:StripChart.java


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