Refine search
renderer.setBaseToolTipGenerator(new StandardCategoryToolTipGenerator());
/** * Tests if this object is equal to another. * * @param obj the other object. * * @return A boolean. */ public boolean equals(Object obj) { if (obj == this) { return true; } if (obj instanceof BoxAndWhiskerToolTipGenerator) { return super.equals(obj); } return false; }
/** * Generates the tool tip text for an item in a dataset. Note: in the * current dataset implementation, each row is a series, and each column * contains values for a particular category. * * @param dataset the dataset (<code>null</code> not permitted). * @param row the row index (zero-based). * @param column the column index (zero-based). * * @return The tooltip text (possibly <code>null</code>). */ public String generateToolTip(CategoryDataset dataset, int row, int column) { return generateLabelString(dataset, row, column); }
throw new IllegalArgumentException("Null 'orientation' argument."); CategoryAxis categoryAxis = new CategoryAxis(categoryAxisLabel); categoryAxis.setCategoryMargin(0.0); ValueAxis valueAxis = new NumberAxis(valueAxisLabel); new StandardCategoryToolTipGenerator()); CategoryPlot plot = new CategoryPlot(dataset, categoryAxis, valueAxis, renderer); plot.setOrientation(orientation); JFreeChart chart = new JFreeChart(title, JFreeChart.DEFAULT_TITLE_FONT, plot, legend); currentTheme.apply(chart);
CategoryPlot categoryPlot = (CategoryPlot) plot.getPlot(); categoryPlot.setDomainGridlinePaint(Color.black); categoryPlot.setRangeGridlinePaint(Color.black); categoryPlot.setDrawingSupplier(Plot.SUPPLIER); CategoryAxis domainAxis = new ShiftedCategoryAxis(Messages.Plot_Build()); categoryPlot.setDomainAxis(domainAxis); domainAxis.setCategoryLabelPositions(CategoryLabelPositions.UP_90); domainAxis.setLowerMargin(0.0); domainAxis.setUpperMargin(0.03); domainAxis.setCategoryMargin(0.0); for (Object category : dataset.getColumnKeys()) { if ((rangeAxis != null) && (rangeAxis instanceof NumberAxis)) { if (hasYaxisMinimum()) { ((NumberAxis) rangeAxis).setLowerBound(getYaxisMinimum()); ((NumberAxis) rangeAxis).setUpperBound(getYaxisMaximum()); ((NumberAxis) rangeAxis).setAutoRangeIncludesZero(!getExclZero()); renderer.setBaseToolTipGenerator(new StandardCategoryToolTipGenerator( Messages.Plot_Build() + " {1}: {2}", NumberFormat.getInstance())); renderer.setBaseItemURLGenerator(new PointURLGenerator());
false // URLs? ); CategoryPlot plot = this.chart_.getCategoryPlot(); plot.setDomainAxisLocation(AxisLocation.BOTTOM_OR_RIGHT); plot.setDataset(1, dataset1); plot.mapDatasetToRangeAxis(1, 1); renderer.setSeriesToolTipGenerator(0, new StandardCategoryToolTipGenerator()); plot.setRenderer(0, renderer); final CategoryAxis axis1 = new CategoryAxis("Hour"); axis1.setTickLabelFont(new Font("SansSerif", Font.PLAIN, 7)); plot.setDomainAxis(axis1); final ValueAxis axis2 = new NumberAxis("Mean bias [veh/h]"); plot.setRangeAxis(1, axis2); renderer2.setSeriesToolTipGenerator(0, new StandardCategoryToolTipGenerator()); renderer2.setSeriesToolTipGenerator(1, new StandardCategoryToolTipGenerator()); plot.setRenderer(1, renderer2);
false // URLs? ); CategoryPlot plot = this.chart_.getCategoryPlot(); plot.getDomainAxis().setCategoryLabelPositions(CategoryLabelPositions.UP_45); renderer.setSeriesOutlinePaint(0, Color.black); renderer.setSeriesPaint(0, Color.getHSBColor((float) 0.62, (float) 0.56, (float) 0.93)); renderer.setSeriesToolTipGenerator(0, new StandardCategoryToolTipGenerator()); renderer.setItemMargin(0.0); this.chart_.setBackgroundPaint(Color.getHSBColor((float) 0.0, (float) 0.0, (float) 0.93)); plot.setBackgroundPaint(Color.white); plot.setRangeGridlinePaint(Color.gray); plot.setRangeGridlinesVisible(true); final CategoryAxis axis1 = plot.getDomainAxis(); axis1.setCategoryMargin(0.25); // leave a gap of 25% between categories
public ChartPanel getPlotCanvas() { final JFreeChart chart = ChartFactory.createBarChart( "JBroFuzz Hamming Distance Bar Chart", // chart title "File Name", // domain axis label "Hamming Distance", // range axis label dataset, // data PlotOrientation.VERTICAL, // orientation false, // include legend true, // tooltips? true // URLs? ); final Plot plot = chart.getPlot(); plot.setBackgroundImage(ImageCreator.IMG_OWASP_MED.getImage()); plot.setBackgroundImageAlignment(Align.TOP_RIGHT); final CategoryItemRenderer renderer = chart.getCategoryPlot().getRenderer(); renderer.setBaseToolTipGenerator( new StandardCategoryToolTipGenerator()); return new ChartPanel(chart); }
CategoryAxis catAxis = new CategoryAxis( categoryAxisLabel ); NumberAxis barsAxis = new NumberAxis( valueAxisLabel ); NumberAxis linesAxis = new NumberAxis( secondValueAxisLabel ); linesDataset.setRangeTitleFont( chartDefinition.getLinesRangeTitleFont() ); if ( chartDefinition.getLinesRangeTickFormat() != null ) { linesAxis.setNumberFormatOverride( chartDefinition.getLinesRangeTickFormat() ); barRenderer.setBaseToolTipGenerator( new StandardCategoryToolTipGenerator() ); lineRenderer.setBaseToolTipGenerator( new StandardCategoryToolTipGenerator() ); CategoryPlot plot = new CategoryPlot( barsDataset, catAxis, barsAxis, barRenderer ); plot.setRenderer( 1, lineRenderer ); plot.setDataset( 1, linesDataset ); plot.setRangeAxis( 1, linesAxis ); JFreeChart chart = new JFreeChart( title, JFreeChart.DEFAULT_TITLE_FONT, plot, legend );
throw new IllegalArgumentException("Null 'orientation' argument."); CategoryAxis categoryAxis = new CategoryAxis(categoryAxisLabel); categoryAxis.setCategoryMargin(0.0); ValueAxis valueAxis = new NumberAxis(valueAxisLabel); = new StandardCategoryToolTipGenerator(); renderer.setBaseToolTipGenerator(generator); CategoryPlot plot = new CategoryPlot(dataset, categoryAxis, valueAxis, renderer); plot.clearRangeMarkers(); Marker baseline = new ValueMarker(0.0); baseline.setPaint(Color.black); plot.addRangeMarker(baseline, Layer.FOREGROUND); plot.setOrientation(orientation); JFreeChart chart = new JFreeChart(title, JFreeChart.DEFAULT_TITLE_FONT, plot, legend); currentTheme.apply(chart);
renderer.setToolTipGenerator(new StandardCategoryToolTipGenerator()); NumberAxis rangeAxisX = new NumberAxis(resultUnitX); CategoryPlot subplotX = new CategoryPlot(datasetX, null, rangeAxisX, renderer); subplotX.setForegroundAlpha(0.7f); subplotX.setFixedLegendItems(new LegendItemCollection()); NumberAxis rangeAxis = new NumberAxis(resultUnit); CategoryPlot subplot = new CategoryPlot(dataset, null, rangeAxis, renderer); JFreeChart chart = new JFreeChart( hasValueX ? chartTitle : (chartTitle + "(" + resultUnit + ")"), new Font("SansSerif", Font.BOLD, 14), plot, true); chart.setAntiAlias(true); ChartUtilities.saveChartAsJPEG( new File(baseName + Integer.toString(nOfFiles) + extension),
CategoryPlot plot = (CategoryPlot) chart.getPlot(); BarRenderer renderer = (BarRenderer) plot.getRenderer(); renderer.setToolTipGenerator(new StandardCategoryToolTipGenerator("{1}: {2} " + i18nBean.getText("datacollector.hourstorespond"), NumberFormat.getInstance())); plot.setRenderer(renderer);
/** * Utility method to set the default style of the Bar Charts * * @param chart {@link JFreeChart} to style */ private static void setBarChartDefaults(JFreeChart chart) { ChartUtil.setDefaults(chart); CategoryPlot plot = (CategoryPlot) chart.getPlot(); plot.setAxisOffset(new RectangleInsets(1.0, 1.0, 1.0, 1.0)); // renderer BarRenderer renderer = (BarRenderer) plot.getRenderer(); renderer.setBaseItemLabelFont(ChartDefaults.defaultFont); renderer.setBaseItemLabelsVisible(false); renderer.setBasePositiveItemLabelPosition( new ItemLabelPosition(ItemLabelAnchor.OUTSIDE12, TextAnchor.BOTTOM_CENTER)); renderer.setBaseItemLabelGenerator(new StandardCategoryItemLabelGenerator()); renderer.setBaseItemLabelPaint(ChartDefaults.axisLabelColor); StandardCategoryToolTipGenerator generator = new StandardCategoryToolTipGenerator("{1}, {2}", NumberFormat.getInstance()); renderer.setBaseToolTipGenerator(generator); renderer.setDrawBarOutline(false); renderer.setMaximumBarWidth(0.1); renderer.setItemMargin(0.02f); for (int j = 0; j < ChartDefaults.darkColors.length; j++) { renderer.setSeriesPaint(j, ChartDefaults.darkColors[j]); } }
if (tooltips) { renderer.setBaseToolTipGenerator( new StandardCategoryToolTipGenerator()); CategoryPlot plot = new CategoryPlot(dataset, categoryAxis, valueAxis, renderer); plot.setOrientation(orientation); if (orientation == PlotOrientation.HORIZONTAL) { plot.setRowRenderingOrder(SortOrder.DESCENDING); plot.setColumnRenderingOrder(SortOrder.DESCENDING); plot.setForegroundAlpha(0.75f); JFreeChart chart = new JFreeChart(title, JFreeChart.DEFAULT_TITLE_FONT, plot, legend); currentTheme.apply(chart);
CategoryAxis categoryAxis = new CategoryAxis(categoryAxisLabel); ValueAxis valueAxis = new NumberAxis(valueAxisLabel); new StandardCategoryToolTipGenerator()); plot.setOrientation(orientation); JFreeChart chart = new JFreeChart(title, font, plot, legend);
if (tooltips) { renderer.setBaseToolTipGenerator( new StandardCategoryToolTipGenerator()); CategoryPlot plot = new CategoryPlot(dataset, categoryAxis, valueAxis, renderer); plot.setOrientation(orientation); if (orientation == PlotOrientation.HORIZONTAL) { plot.setColumnRenderingOrder(SortOrder.DESCENDING); JFreeChart chart = new JFreeChart(title, JFreeChart.DEFAULT_TITLE_FONT, plot, legend); currentTheme.apply(chart);
throw new IllegalArgumentException("Null 'orientation' argument."); CategoryAxis categoryAxis = new CategoryAxis(categoryAxisLabel); categoryAxis.setCategoryMargin(0.0); ValueAxis valueAxis = new NumberAxis(valueAxisLabel); new StandardCategoryToolTipGenerator()); CategoryPlot plot = new CategoryPlot(dataset, categoryAxis, valueAxis, renderer); plot.setOrientation(orientation); JFreeChart chart = new JFreeChart(title, JFreeChart.DEFAULT_TITLE_FONT, plot, legend); currentTheme.apply(chart);
false // URLs? ); CategoryPlot plot = this.chart_.getCategoryPlot(); plot.setDomainAxisLocation(AxisLocation.BOTTOM_OR_RIGHT); plot.setDataset(1, dataset1); plot.mapDatasetToRangeAxis(1, 1); new StandardCategoryToolTipGenerator()); plot.setRenderer(0, renderer); final CategoryAxis axis1 = new CategoryAxis("Hour"); axis1.setTickLabelFont(new Font("SansSerif", Font.PLAIN, 7)); plot.setDomainAxis(axis1); final ValueAxis axis2 = new NumberAxis("Mean abs bias [veh/h]"); plot.setRangeAxis(1, axis2); new StandardCategoryToolTipGenerator()); renderer2.setSeriesToolTipGenerator(1, new StandardCategoryToolTipGenerator()); plot.setRenderer(1, renderer2);
false // URLs? ); CategoryPlot plot = this.chart_.getCategoryPlot(); plot.getDomainAxis().setCategoryLabelPositions(CategoryLabelPositions.UP_45); renderer.setSeriesToolTipGenerator(0, new StandardCategoryToolTipGenerator()); renderer.setSeriesToolTipGenerator(1, new StandardCategoryToolTipGenerator()); renderer.setItemMargin(0.0); this.chart_.setBackgroundPaint(Color.getHSBColor((float) 0.0, (float) 0.0, (float) 0.93)); plot.setBackgroundPaint(Color.white); plot.setRangeGridlinePaint(Color.gray); plot.setRangeGridlinesVisible(true); final CategoryAxis axis1 = plot.getDomainAxis(); axis1.setCategoryMargin(0.25); // leave a gap of 25% between categories
public ChartPanel getPlotCanvas() { final JFreeChart chart = ChartFactory.createBarChart( "JBroFuzz Jaccard Index Bar Chart", // chart title "File Name", // domain axis label "Jaccard Similarity Coefficient", // range axis label dataset, // data PlotOrientation.VERTICAL, // orientation false, // include legend true, // tooltips? true // URLs? ); final Plot plot = chart.getPlot(); plot.setBackgroundImage(ImageCreator.IMG_OWASP_MED.getImage()); plot.setBackgroundImageAlignment(Align.TOP_RIGHT); final CategoryItemRenderer renderer = chart.getCategoryPlot().getRenderer(); renderer .setBaseToolTipGenerator(new StandardCategoryToolTipGenerator()); return new ChartPanel(chart); }