List of usage examples for org.jfree.chart JFreeChartConstants DEFAULT_TITLE_FONT
Font DEFAULT_TITLE_FONT
To view the source code for org.jfree.chart JFreeChartConstants DEFAULT_TITLE_FONT.
Click Source Link
From source file:com.sixrr.metrics.ui.charts.DistributionDialog.java
private JFreeChart createChart(XYDataset dataset) { final String title = getTitle(); final NumberAxis xAxis = new NumberAxis(metricName); xAxis.setAutoRangeIncludesZero(false); if (metricType == MetricType.Ratio || metricType == MetricType.RecursiveRatio) { xAxis.setNumberFormatOverride(new PercentFormatter()); }/*from w ww . j a v a2s . c o m*/ final NumberAxis yAxis = new NumberAxis("%"); final XYItemRenderer renderer = new StandardXYItemRenderer(StandardXYItemRenderer.LINES); final XYPlot plot = new XYPlot(dataset, xAxis, yAxis, renderer); plot.setOrientation(PlotOrientation.VERTICAL); renderer.setToolTipGenerator(new StandardXYToolTipGenerator()); return new JFreeChart(title, JFreeChartConstants.DEFAULT_TITLE_FONT, plot, true); }
From source file:com.sixrr.metrics.ui.charts.PieChartDialog.java
private JFreeChart createChart(PieDataset dataset) { final String title = getTitle(); final PiePlot plot = new PiePlot(dataset); plot.setInsets(new Insets(0, 5, 5, 5)); final int numItems = dataset.getItemCount(); int total = 0; for (int i = 0; i < numItems; i++) { final Number value = dataset.getValue(i); total += value.intValue();//from w w w .ja v a2s. co m } final PieItemLabelGenerator tooltipGenerator = new PieChartTooltipGenerator(total); plot.setItemLabelGenerator(tooltipGenerator); plot.setURLGenerator(null); return new JFreeChart(title, JFreeChartConstants.DEFAULT_TITLE_FONT, plot, false); }
From source file:com.sixrr.metrics.ui.charts.HistogramDialog.java
private JFreeChart createChart(IntervalXYDataset dataset, boolean isIntegral) { final String title = getTitle(); final NumberAxis xAxis = new NumberAxis(); if (isIntegral) { xAxis.setTickUnit(new NumberTickUnit(1.0)); }//w w w . j av a 2 s.co m if (metricType == MetricType.Ratio || metricType == MetricType.RecursiveRatio) { xAxis.setNumberFormatOverride(new PercentFormatter()); } final XYToolTipGenerator tooltipGenerator = new StandardXYToolTipGenerator(); final XYItemRenderer renderer = new XYBarRenderer(); renderer.setToolTipGenerator(tooltipGenerator); renderer.setURLGenerator(null); final ValueAxis yAxis = new NumberAxis(); final XYPlot plot = new XYPlot(dataset, xAxis, yAxis, null); plot.setRenderer(renderer); plot.setOrientation(PlotOrientation.VERTICAL); return new JFreeChart(title, JFreeChartConstants.DEFAULT_TITLE_FONT, plot, true); }
From source file:com.sixrr.metrics.ui.charts.DiffDistributionDialog.java
private JFreeChart createChart(XYDataset dataset) { final String title = getTitle(); final NumberAxis xAxis = new NumberAxis(metricName); xAxis.setAutoRangeIncludesZero(false); if (metricType.equals(MetricType.Ratio) || metricType.equals(MetricType.RecursiveRatio)) { xAxis.setNumberFormatOverride(new PercentFormatter()); }//from w w w. j a v a 2 s. c o m final NumberAxis yAxis = new NumberAxis("%"); final XYItemRenderer renderer = new StandardXYItemRenderer(StandardXYItemRenderer.LINES); final XYPlot plot = new XYPlot(dataset, xAxis, yAxis, renderer); plot.setOrientation(PlotOrientation.VERTICAL); renderer.setToolTipGenerator(new StandardXYToolTipGenerator()); return new JFreeChart(title, JFreeChartConstants.DEFAULT_TITLE_FONT, plot, true); }
From source file:com.sixrr.metrics.ui.charts.DiffHistogramDialog.java
private JFreeChart createChart(IntervalXYDataset dataset, boolean isIntegral) { final String title = getTitle(); final NumberAxis xAxis = new NumberAxis(); if (metricType.equals(MetricType.Ratio) || metricType.equals(MetricType.RecursiveRatio)) { xAxis.setNumberFormatOverride(new PercentFormatter()); }// w w w. j a v a2s.c o m if (isIntegral) { xAxis.setTickUnit(new NumberTickUnit(1.0)); } final XYToolTipGenerator tooltipGenerator = new StandardXYToolTipGenerator(); final XYItemRenderer renderer = new XYBarRenderer(); renderer.setToolTipGenerator(tooltipGenerator); renderer.setURLGenerator(null); final ValueAxis yAxis = new NumberAxis(); final XYPlot plot = new XYPlot(dataset, xAxis, yAxis, null); plot.setRenderer(renderer); plot.setOrientation(PlotOrientation.VERTICAL); return new JFreeChart(title, JFreeChartConstants.DEFAULT_TITLE_FONT, plot, true); }