当前位置: 首页>>代码示例>>Java>>正文


Java BoxAndWhiskerToolTipGenerator类代码示例

本文整理汇总了Java中org.jfree.chart.labels.BoxAndWhiskerToolTipGenerator的典型用法代码示例。如果您正苦于以下问题:Java BoxAndWhiskerToolTipGenerator类的具体用法?Java BoxAndWhiskerToolTipGenerator怎么用?Java BoxAndWhiskerToolTipGenerator使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


BoxAndWhiskerToolTipGenerator类属于org.jfree.chart.labels包,在下文中一共展示了BoxAndWhiskerToolTipGenerator类的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: createBoxAndWhiskerChart

import org.jfree.chart.labels.BoxAndWhiskerToolTipGenerator; //导入依赖的package包/类
/**
 * Creates and returns a default instance of a box and whisker chart
 * based on data from a {@link BoxAndWhiskerCategoryDataset}.
 *
 * @param title  the chart title (<code>null</code> permitted).
 * @param categoryAxisLabel  a label for the category axis 
 *     (<code>null</code> permitted).
 * @param valueAxisLabel  a label for the value axis (<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 box and whisker chart.
 * 
 * @since 1.0.4
 */
public static JFreeChart createBoxAndWhiskerChart(String title,
        String categoryAxisLabel, String valueAxisLabel,
        BoxAndWhiskerCategoryDataset dataset, boolean legend) {
    
    CategoryAxis categoryAxis = new CategoryAxis(categoryAxisLabel);
    NumberAxis valueAxis = new NumberAxis(valueAxisLabel);
    valueAxis.setAutoRangeIncludesZero(false);
    
    BoxAndWhiskerRenderer renderer = new BoxAndWhiskerRenderer();
    renderer.setToolTipGenerator(new BoxAndWhiskerToolTipGenerator());
       
    CategoryPlot plot = new CategoryPlot(dataset, categoryAxis, valueAxis, 
            renderer);
    return new JFreeChart(title, JFreeChart.DEFAULT_TITLE_FONT, plot, 
            legend);
}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:33,代码来源:ChartFactory.java

示例2: createBoxAndWhiskerChart

import org.jfree.chart.labels.BoxAndWhiskerToolTipGenerator; //导入依赖的package包/类
/**
 * Creates and returns a default instance of a box and whisker chart
 * based on data from a {@link BoxAndWhiskerCategoryDataset}.
 *
 * @param title  the chart title (<code>null</code> permitted).
 * @param categoryAxisLabel  a label for the category axis
 *     (<code>null</code> permitted).
 * @param valueAxisLabel  a label for the value axis (<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 box and whisker chart.
 *
 * @since 1.0.4
 */
public static JFreeChart createBoxAndWhiskerChart(String title,
        String categoryAxisLabel, String valueAxisLabel,
        BoxAndWhiskerCategoryDataset dataset, boolean legend) {

    CategoryAxis categoryAxis = new CategoryAxis(categoryAxisLabel);
    NumberAxis valueAxis = new NumberAxis(valueAxisLabel);
    valueAxis.setAutoRangeIncludesZero(false);

    BoxAndWhiskerRenderer renderer = new BoxAndWhiskerRenderer();
    renderer.setBaseToolTipGenerator(new BoxAndWhiskerToolTipGenerator());

    CategoryPlot plot = new CategoryPlot(dataset, categoryAxis, valueAxis,
            renderer);
    JFreeChart chart = new JFreeChart(title, JFreeChart.DEFAULT_TITLE_FONT,
            plot, legend);
    currentTheme.apply(chart);
    return chart;
}
 
开发者ID:mdzio,项目名称:ccu-historian,代码行数:35,代码来源:ChartFactory.java

示例3: createBoxAndWhiskerChart

import org.jfree.chart.labels.BoxAndWhiskerToolTipGenerator; //导入依赖的package包/类
/**
 * Creates and returns a default instance of a box and whisker chart
 * based on data from a {@link BoxAndWhiskerCategoryDataset}.
 *
 * @param title  the chart title ({@code null} permitted).
 * @param categoryAxisLabel  a label for the category axis
 *     ({@code null} permitted).
 * @param valueAxisLabel  a label for the value axis ({@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.
 *
 * @return A box and whisker chart.
 *
 * @since 1.0.4
 */
public static JFreeChart createBoxAndWhiskerChart(String title,
        String categoryAxisLabel, String valueAxisLabel,
        BoxAndWhiskerCategoryDataset dataset, boolean legend) {

    CategoryAxis categoryAxis = new CategoryAxis(categoryAxisLabel);
    NumberAxis valueAxis = new NumberAxis(valueAxisLabel);
    valueAxis.setAutoRangeIncludesZero(false);

    BoxAndWhiskerRenderer renderer = new BoxAndWhiskerRenderer();
    renderer.setDefaultToolTipGenerator(new BoxAndWhiskerToolTipGenerator());

    CategoryPlot plot = new CategoryPlot(dataset, categoryAxis, valueAxis,
            renderer);
    JFreeChart chart = new JFreeChart(title, JFreeChart.DEFAULT_TITLE_FONT,
            plot, legend);
    currentTheme.apply(chart);
    return chart;
}
 
开发者ID:jfree,项目名称:jfreechart,代码行数:35,代码来源:ChartFactory.java

示例4: boxWhiskerPlot

import org.jfree.chart.labels.BoxAndWhiskerToolTipGenerator; //导入依赖的package包/类
/**
 * Plots Data for Chart
 */
private void boxWhiskerPlot() {
    BoxAndWhiskerCategoryDataset dataset = createDataset();
    CategoryAxis xAxis = new CategoryAxis("Model");
    NumberAxis yAxis = new NumberAxis("Fitness");
    yAxis.setRange(0.0, 1.0);

    BoxAndWhiskerRenderer renderer = new BoxAndWhiskerRenderer();
    renderer.setFillBox(false);
    renderer.setMaximumBarWidth(0.2);
    renderer.setItemMargin(0.5);
    renderer.setToolTipGenerator(new BoxAndWhiskerToolTipGenerator());
    CategoryPlot plot = new CategoryPlot(dataset, xAxis, yAxis, renderer);
    plot.setOrientation(PlotOrientation.HORIZONTAL);

    chart = new JFreeChart(
            "Model comparison",
            new Font("Palatino", Font.BOLD, 14),
            plot,
            true
    );
    chart.removeLegend();
    // boxWhiskerPane.setCenter(viewer);
}
 
开发者ID:informatik-mannheim,项目名称:Moduro-Toolbox,代码行数:27,代码来源:BoxAndWhiskersPlotDiagram.java

示例5: init

import org.jfree.chart.labels.BoxAndWhiskerToolTipGenerator; //导入依赖的package包/类
protected void init()
{
    dataset = new DefaultBoxAndWhiskerCategoryDataset();

    final BoxAndWhiskerRenderer renderer = new BoxAndWhiskerRenderer();
    renderer.setFillBox(false);
    renderer.setToolTipGenerator(new BoxAndWhiskerToolTipGenerator());
    final CategoryAxis xAxis = new CategoryAxis("Type");
    final NumberAxis yAxis = new NumberAxis("Value");
    final CategoryPlot plot = new CategoryPlot(dataset, xAxis, yAxis, renderer);

    final JFreeChart chart = new JFreeChart(
            getName(),
            new Font("SansSerif", Font.BOLD, 14),
            plot,
            true
    );

    init(chart.getPlot());
}
 
开发者ID:dhmay,项目名称:msInspect,代码行数:21,代码来源:PanelWithBoxAndWhiskerChart.java

示例6: updateCategoryPlot

import org.jfree.chart.labels.BoxAndWhiskerToolTipGenerator; //导入依赖的package包/类
public CategoryPlot updateCategoryPlot(CategoryPlot categoryPlot, NumberFormat numberFormat,
		BoxAndWhiskerItem boxAndWhiskerItem, Color color, boolean notify) {

	// Box and Whisker Plot
	NumberAxis valueAxis = new NumberAxis();
	valueAxis.setAutoRangeIncludesZero(false);

	valueAxis.setNumberFormatOverride(numberFormat);

	valueAxis.setStandardTickUnits(NumberAxis.createIntegerTickUnits());

	BoxAndWhiskerRenderer boxAndWhiskerRenderer = new BoxAndWhiskerRenderer();
	boxAndWhiskerRenderer.setBaseToolTipGenerator(new BoxAndWhiskerToolTipGenerator());
	boxAndWhiskerRenderer.setMaximumBarWidth(0.3);
	boxAndWhiskerRenderer.setBasePaint(color);
	boxAndWhiskerRenderer.setBaseOutlinePaint(color);
	boxAndWhiskerRenderer.setAutoPopulateSeriesPaint(false);
	boxAndWhiskerRenderer.setFillBox(false);
	boxAndWhiskerRenderer.setUseOutlinePaintForWhiskers(true);

	DefaultBoxAndWhiskerCategoryDataset dbawcd = new DefaultBoxAndWhiskerCategoryDataset();
	dbawcd.add(boxAndWhiskerItem, "", "");

	categoryPlot.setRenderer(boxAndWhiskerRenderer, notify);
	categoryPlot.setRangeAxis(0, valueAxis, notify);

	categoryPlot.setDataset(dbawcd);

	return categoryPlot;
}
 
开发者ID:pegasystems,项目名称:pega-logviewer,代码行数:31,代码来源:LogViewerUtil.java

示例7: createRenderer

import org.jfree.chart.labels.BoxAndWhiskerToolTipGenerator; //导入依赖的package包/类
/**
 * Creates a Renderer object to that can draw the BoxPlot.
 *
 * @return a BoxAndWhiskerRenderer that can render the boxplot
 */
private static BoxAndWhiskerRenderer createRenderer(
		final boolean meanVisible, final boolean fillBox) {
	BoxAndWhiskerRenderer renderer = new BoxAndWhiskerRenderer();
	renderer.setMeanVisible(meanVisible);
	renderer.setFillBox(fillBox);
	renderer.setBaseToolTipGenerator(new BoxAndWhiskerToolTipGenerator());

	return renderer;
}
 
开发者ID:adamIqbal,项目名称:Health,代码行数:15,代码来源:BoxPlot.java

示例8: testHashCode

import org.jfree.chart.labels.BoxAndWhiskerToolTipGenerator; //导入依赖的package包/类
/**
 * Simple check that hashCode is implemented.
 */
public void testHashCode() {
    BoxAndWhiskerToolTipGenerator g1 = new BoxAndWhiskerToolTipGenerator();
    BoxAndWhiskerToolTipGenerator g2 = new BoxAndWhiskerToolTipGenerator();
    assertTrue(g1.equals(g2));
    assertTrue(g1.hashCode() == g2.hashCode());
}
 
开发者ID:SpoonLabs,项目名称:astor,代码行数:10,代码来源:BoxAndWhiskerToolTipGeneratorTests.java

示例9: getChart

import org.jfree.chart.labels.BoxAndWhiskerToolTipGenerator; //导入依赖的package包/类
public JFreeChart getChart() {
    if (chart == null) {
        createDataset();
        chart = ChartFactory.createBarChart(getTitle(),
        // chart title
                "Category",
                // domain axis label
                "Value",
                // range axis label
                dataset,
                // data
                PlotOrientation.VERTICAL,
                // orientation
                false,
                // include legend
                true,
                // tooltips?
                false
        // URLs?
                );
        CategoryPlot plot = (CategoryPlot) chart.getPlot();
        CategoryAxis rangeAxis = plot.getDomainAxis();
        rangeAxis.setCategoryLabelPositions(CategoryLabelPositions.UP_90);
        final BoxAndWhiskerRenderer renderer = new BoxAndWhiskerRenderer();
        renderer.setFillBox(true);
        renderer.setToolTipGenerator(new BoxAndWhiskerToolTipGenerator());
        renderer.setMeanVisible(isMeanVisible);
        plot.setRenderer(renderer);
    }

    return chart;
}
 
开发者ID:TheHortonMachine,项目名称:hortonmachine,代码行数:33,代码来源:CategoryBoxplot.java

示例10: writeToFile

import org.jfree.chart.labels.BoxAndWhiskerToolTipGenerator; //导入依赖的package包/类
public void writeToFile(String outName) throws FileNotFoundException, UnsupportedEncodingException, IOException
{
    //calcMeans();
    
    // Create JFreeChart Dataset
    DefaultBoxAndWhiskerCategoryDataset dataset = new DefaultBoxAndWhiskerCategoryDataset( );
    
    
    HashMap<String, ArrayList<Double> > measuresFirst = algorithmMeasures.entrySet().iterator().next().getValue();
    for (Map.Entry<String, ArrayList<Double> > measure : measuresFirst.entrySet())
    {
        String measureName = measure.getKey();
        //Double measureValue = measure.getValue();
        dataset.clear();
        
        for (Map.Entry<String, HashMap<String, ArrayList<Double> >> entry : algorithmMeasures.entrySet())
        {
            String alg = entry.getKey();
            ArrayList<Double> measureValues = entry.getValue().get(measureName);
            
            // Parse algorithm name to show it correctly
            String aName = alg.substring(0, alg.length()-1);
            int startAlgName = aName.lastIndexOf("/");
            aName = aName.substring(startAlgName + 1);
            
            dataset.add(measureValues, aName, measureName);
        }
        
        // Tutorial: http://www.java2s.com/Code/Java/Chart/JFreeChartBoxAndWhiskerDemo.htm
        final CategoryAxis xAxis = new CategoryAxis("Algorithm");
        final NumberAxis yAxis = new NumberAxis("Value");
        yAxis.setAutoRangeIncludesZero(false);
        final BoxAndWhiskerRenderer renderer = new BoxAndWhiskerRenderer();
        
        // Black and White
        int numItems = algorithmMeasures.size();
        for(int i=0;i<numItems;i++)
        {
            Color color = Color.DARK_GRAY;
            if(i%2 == 1)
            {
                color = Color.LIGHT_GRAY;
            }
            renderer.setSeriesPaint(i, color);
            renderer.setSeriesOutlinePaint(i, Color.BLACK);
        }
        
        renderer.setMeanVisible(false);
        renderer.setFillBox(false);
        renderer.setToolTipGenerator(new BoxAndWhiskerToolTipGenerator());
        final CategoryPlot plot = new CategoryPlot(dataset, xAxis, yAxis, renderer);

        Font font = new Font("SansSerif", Font.BOLD, 10);
        //ChartFactory.setChartTheme(StandardChartTheme.createLegacyTheme());
        JFreeChart jchart = new JFreeChart("Assotiation Rules Measures - BoxPlot", font, plot, true);
        //StandardChartTheme.createLegacyTheme().apply(jchart);
     
        int width = 640 * 2; /* Width of the image */
        int height = 480 * 2; /* Height of the image */ 

        // JPEG
        File chart = new File( outName + "_" + measureName + "_boxplot.jpg" );
        ChartUtilities.saveChartAsJPEG( chart , jchart , width , height );

        // SVG
        SVGGraphics2D g2 = new SVGGraphics2D(width, height);
        Rectangle r = new Rectangle(0, 0, width, height);
        jchart.draw(g2, r);
        File BarChartSVG = new File( outName + "_" + measureName + "_boxplot.svg" );
        SVGUtils.writeToSVG(BarChartSVG, g2.getSVGElement());
    }
    
}
 
开发者ID:SCI2SUGR,项目名称:KEEL,代码行数:74,代码来源:ResultsProccessor.java

示例11: testPublicCloneable

import org.jfree.chart.labels.BoxAndWhiskerToolTipGenerator; //导入依赖的package包/类
/**
 * Check to ensure that this class implements PublicCloneable.
 */
public void testPublicCloneable() {
    BoxAndWhiskerToolTipGenerator g1 = new BoxAndWhiskerToolTipGenerator();
    assertTrue(g1 instanceof PublicCloneable);
}
 
开发者ID:SpoonLabs,项目名称:astor,代码行数:8,代码来源:BoxAndWhiskerToolTipGeneratorTests.java

示例12: Evaluation

import org.jfree.chart.labels.BoxAndWhiskerToolTipGenerator; //导入依赖的package包/类
public Evaluation(){
		String[] nameOfTestInstances = {"att48","brg180","ch150","gr202"};
		int[] numberOfTestRuns = {100,100,50,20};
		int[] timeLimits = {1,2,15,120};
		LinkedList<Double> ilsResults = new LinkedList<Double>();
		LinkedList<Double> memeResults = new LinkedList<Double>();       

        final DefaultBoxAndWhiskerCategoryDataset dataset 
            = new DefaultBoxAndWhiskerCategoryDataset();
		try {
			for(int j = 0; j < nameOfTestInstances.length; j++)
			{
//				dataset.clear();
				for(int i = 0; i<numberOfTestRuns[j]; i++)
				{
					String[] arguments = {nameOfTestInstances[j], String.valueOf(timeLimits[j]), String.valueOf(50), "noDiagrams"};
					double[] results = TSP_Main.main(arguments);
					ilsResults.add(results[0]);
					memeResults.add(results[1]);					
				}
				dataset.add(ilsResults, "Iterated Local Search", nameOfTestInstances[j]);
				dataset.add(memeResults, "Memetic Algorithm", nameOfTestInstances[j]);
				ilsResults.clear();
				memeResults.clear();

			}
	        final CategoryAxis xAxis = new CategoryAxis("Name of TSPLIB instance");
	        final NumberAxis yAxis = new NumberAxis("deviation from optimum in %");
//	        yAxis.setAutoRangeIncludesZero(false);
	        final BoxAndWhiskerRenderer renderer = new BoxAndWhiskerRenderer();
//	        renderer.setFillBox(false);
	        renderer.setToolTipGenerator(new BoxAndWhiskerToolTipGenerator());
	        renderer.setMeanVisible(false);
	        renderer.setMaximumBarWidth(10);
	        final CategoryPlot plot = new CategoryPlot(dataset, xAxis, yAxis, renderer);
	        final NumberAxis axis = (NumberAxis) plot.getRangeAxis();
	        axis.setRange(Range.expandToInclude(axis.getRange(), -0.2));
	        final JFreeChart chart = new JFreeChart(
	            "Comparison of ILS and Memetic Algorithm",
	            new Font("SansSerif", Font.BOLD, 16),
	            plot,
	            true
	        );
	        final ChartPanel chartPanel = new ChartPanel(chart);
//	        chartPanel.setPreferredSize(new java.awt.Dimension(900, 540));
	        ChartUtilities.saveChartAsJPEG(new File("evaluation"), chart, 500, 400);
	        setContentPane(chartPanel);
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}
 
开发者ID:Epsilon2,项目名称:Memetic-Algorithm-for-TSP,代码行数:53,代码来源:Evaluation.java


注:本文中的org.jfree.chart.labels.BoxAndWhiskerToolTipGenerator类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。