List of usage examples for org.jfree.chart JFreeChart DEFAULT_TITLE_FONT
Font DEFAULT_TITLE_FONT
To view the source code for org.jfree.chart JFreeChart DEFAULT_TITLE_FONT.
Click Source Link
From source file:bzstats.chart.KillRatioHistoryChart.java
protected JFreeChart getChart() { DefaultTableXYDataset dataset = new DefaultTableXYDataset(); fillDataset(dataset);//from w ww. ja v a 2 s.c o m XYPlot plot = new XYPlot(); NumberAxis xaxis = new NumberAxis("Time"); xaxis.setTickLabelsVisible(false); NumberAxis yaxis = new NumberAxis("Killratio"); plot.setDomainAxis(xaxis); plot.setRangeAxis(yaxis); plot.setDataset(dataset); plot.setRenderer(new StandardXYItemRenderer(StandardXYItemRenderer.LINES)); JFreeChart chart = new JFreeChart("Killratio", JFreeChart.DEFAULT_TITLE_FONT, plot, true); chart.addSubtitle(new TextTitle("kills/deaths")); chart.setBackgroundPaint(Color.white); return chart; }
From source file:genj.chart.Chart.java
/** * Initializer// w w w .j av a 2s.com */ private void init(String title, Plot plot, boolean legend) { setLayout(new BorderLayout()); ChartPanel panel = new ChartPanel(new JFreeChart(title, JFreeChart.DEFAULT_TITLE_FONT, plot, legend)); // panel.setHorizontalZoom(true); panel.setDomainZoomable(true); // panel.setVerticalZoom(true); panel.setRangeZoomable(true); add(panel, BorderLayout.CENTER); }
From source file:aka.pirana.jdoc.JChart.java
private JPanel createChartPanel() { NumberAxis numberaxis = new NumberAxis("Date"); numberaxis.setAutoRangeIncludesZero(false); NumberAxis numberaxis1 = new NumberAxis("%"); numberaxis1.setAutoRangeIncludesZero(false); XYSplineRenderer xysplinerenderer = new XYSplineRenderer(); XYPlot xyplot = new XYPlot(SampleGenerator(), numberaxis, numberaxis1, xysplinerenderer); xyplot.setBackgroundPaint(Color.lightGray); xyplot.setDomainGridlinePaint(Color.white); xyplot.setRangeGridlinePaint(Color.white); xyplot.setAxisOffset(new RectangleInsets(4D, 4D, 4D, 4D)); JFreeChart jfreechart = new JFreeChart("JDocSplineRenderer", JFreeChart.DEFAULT_TITLE_FONT, xyplot, true); ChartUtilities.applyCurrentTheme(jfreechart); ChartPanel chartpanel = new ChartPanel(jfreechart); return chartpanel; }
From source file:org.quickserver.net.qsadmin.plugin.stats.MeterChart.java
public void setTitle(String title) { meterchart.setTitle(new TextTitle(title, JFreeChart.DEFAULT_TITLE_FONT)); }
From source file:cn.edu.thss.iise.bpmdemo.charts.ThermometerDemo2.java
/** * Creates a new demo./*from w w w. j a v a 2 s . c om*/ * * @param title * the frame title. */ public ThermometerDemo2(final String title) { super(title); plot = new ThermometerPlot(dataset); chart = new JFreeChart("Thermometer Demo 2", // chart title JFreeChart.DEFAULT_TITLE_FONT, plot, // plot false); plot.setThermometerStroke(new BasicStroke(2.0f)); plot.setThermometerPaint(Color.lightGray); // OPTIONAL CUSTOMISATION COMPLETED. // add the chart to a panel... final ChartPanel chartPanel = new ChartPanel(chart); setContentPane(chartPanel); }
From source file:org.cyberoam.iview.charts.Thermometer.java
/** * This method generates JFreeChart instance for Thermometer chart with iView customization. * @param reportID/* w ww .ja va 2 s. co m*/ * @param rsw * @param request * @return */ public static JFreeChart getChart(int reportID, ResultSetWrapper rsw, HttpServletRequest request) { ReportBean reportBean = ReportBean.getRecordbyPrimarykey(reportID); JFreeChart chart = null; ReportColumnBean reportColumnBean = null; GraphBean graphBean = null; try { DefaultValueDataset dataset = null; graphBean = GraphBean.getRecordbyPrimarykey(reportBean.getGraphId()); reportColumnBean = ReportColumnBean.getRecordByPrimaryKey(reportBean.getReportId(), graphBean.getYColumnId()); String yColumnDBname = reportColumnBean.getDbColumnName(); rsw.first(); double used = Double.parseDouble(rsw.getString(yColumnDBname)); rsw.next(); double free = Double.parseDouble(rsw.getString(yColumnDBname)); dataset = new DefaultValueDataset((100 * used) / (used + free)); ThermometerPlot plot = new ThermometerPlot(dataset); chart = new JFreeChart("", // chart title JFreeChart.DEFAULT_TITLE_FONT, plot, // plot false); // include legend chart.setBackgroundPaint(Color.white); plot.setThermometerStroke(new BasicStroke(2.0f)); plot.setThermometerPaint(Color.DARK_GRAY); plot.setBulbRadius(30); plot.setColumnRadius(15); plot.setUnits(ThermometerPlot.UNITS_NONE); plot.setMercuryPaint(Color.WHITE); plot.setValueFont(new Font("Vandara", Font.CENTER_BASELINE, 12)); plot.setBackgroundPaint(Color.white); plot.setBackgroundAlpha(0.0f); plot.setOutlineVisible(false); plot.setSubrangeInfo(0, 0, 50); plot.setSubrangeInfo(1, 50, 85); plot.setSubrangeInfo(2, 85, 100); plot.setSubrangePaint(0, new Color(75, 200, 85)); plot.setSubrangePaint(1, new Color(254, 211, 41)); plot.setSubrangePaint(2, new Color(255, 85, 85)); } catch (Exception e) { CyberoamLogger.appLog.debug("Thermometer=>getChart.exception : " + e, e); } return chart; }
From source file:org.jfree.chart.demo.ThermometerDemo2.java
/** * Creates a new demo./*from w w w . j a v a 2 s.c om*/ * * @param title the frame title. */ public ThermometerDemo2(final String title) { super(title); // create a dataset... final DefaultValueDataset dataset = new DefaultValueDataset(new Double(43.0)); // create the chart... final ThermometerPlot plot = new ThermometerPlot(dataset); final JFreeChart chart = new JFreeChart("Thermometer Demo 2", // chart title JFreeChart.DEFAULT_TITLE_FONT, plot, // plot false); // include legend // NOW DO SOME OPTIONAL CUSTOMISATION OF THE CHART... // plot.setInsets(new Insets(5, 5, 5, 5)); //plot.setRangeInfo(ThermometerPlot.NORMAL, 0.0, 55.0, 0.0, 100.0); //plot.setRangeInfo(ThermometerPlot.WARNING, 55.0, 75.0, 0.0, 100.0); //plot.setRangeInfo(ThermometerPlot.CRITICAL, 75.0, 100.0, 0.0, 100.0); plot.setThermometerStroke(new BasicStroke(2.0f)); plot.setThermometerPaint(Color.lightGray); // OPTIONAL CUSTOMISATION COMPLETED. // add the chart to a panel... final ChartPanel chartPanel = new ChartPanel(chart); setContentPane(chartPanel); }
From source file:org.usfirst.frc.team2084.smartdashboard.extensions.BetterCompass.java
@Override public void init() { // needleType.add("Arrow", 0); // needleType.add("Line", 1); // needleType.add("Long", 2); // needleType.add("Pin", 3); // needleType.add("Plum", 4); // needleType.add("Pointer", 5); // needleType.add("Ship", 6); // needleType.add("Wind", 7); // needleType.add("Arrow Line", 8); // needleType.add("Middle Pin", 9); // needleType.setDefault("Arrow Line"); SwingUtilities.invokeLater(() -> { setLayout(new BorderLayout()); compass = new CompassPlot(getDataset()); compass.setSeriesNeedle(8);//w w w .j av a 2 s .c o m // propertyChanged(needleType); compass.setSeriesPaint(0, Color.RED); compass.setSeriesOutlinePaint(0, Color.RED); JFreeChart chart = new JFreeChart(getFieldName(), JFreeChart.DEFAULT_TITLE_FONT, compass, false); chartPanel = new ChartPanel(chart); chartPanel.setPreferredSize(new Dimension(250, 150)); propertyChanged(circumference); propertyChanged(ringColor); add(chartPanel, BorderLayout.CENTER); revalidate(); repaint(); }); }
From source file:gui.Plotter1D.java
private ChartPanel createChartPanel1(String grapheName) { XYSplineRenderer xysplinerenderer = new XYSplineRenderer(); ValueAxis valueAxis = new NumberAxis("X"); valueAxis.setRange(0.0, 1.0);/*from www. ja va 2 s .c om*/ ValueAxis valueAxisy = new NumberAxis("Y"); valueAxis.setRange(0.0, 1.0); XYPlot xyplot; xyplot = new XYPlot(xyseriescollection, valueAxis, valueAxisy, xysplinerenderer); xyplot.setBackgroundPaint(Color.lightGray); xyplot.setDomainGridlinePaint(Color.white); xyplot.setRangeGridlinePaint(Color.white); xyplot.setAxisOffset(new RectangleInsets(4D, 4D, 4D, 4D)); JFreeChart jfreechart = new JFreeChart(grapheName, JFreeChart.DEFAULT_TITLE_FONT, xyplot, true); jfreechart.setBackgroundPaint(Color.white); ChartPanel chartpanel = new ChartPanel(jfreechart, false); return chartpanel; }
From source file:WeatherFrame.java
public WeatherFrame() { initComponents();// w ww . ja v a 2 s. c om fc = new JFileChooser(); fc.setMultiSelectionEnabled(true); //only can select a single button a time ButtonGroup group = new ButtonGroup(); group.add(AllRadioButton); group.add(YearlyRadioButton); group.add(MonthlyRadioButton); group.add(WeeklyRadioButton); group.add(DailyRadioButton); jComboBox1.setModel(new javax.swing.DefaultComboBoxModel<>(new String[] { "Temperature", "Humidity", "Barometric Pressure", "Windspeed", "UVindex", "Raindfall" })); TempSet = new TimeSeriesCollection(); JFreeChart chart = ChartFactory.createXYLineChart("Temperature", "", "Degree Fahrenheit", TempSet, PlotOrientation.VERTICAL, true, true, false); chart.setBackgroundPaint(Color.white); ChartPanel.setLayout(new java.awt.BorderLayout()); ChartPanel CP = new ChartPanel(chart); CP.setPreferredSize(new Dimension(ChartPanel.getWidth(), ChartPanel.getHeight())); ChartPanel.add(CP, BorderLayout.CENTER); DefaultValueDataset dataset = new DefaultValueDataset(20f); ThermometerPlot thermometerplot = new ThermometerPlot(dataset); JFreeChart jfreechart = new JFreeChart("", JFreeChart.DEFAULT_TITLE_FONT, thermometerplot, true); jfreechart.setBackgroundPaint(new Color(240, 240, 240)); thermometerplot.setThermometerPaint(Color.lightGray); thermometerplot.setThermometerStroke(new BasicStroke(2.0F)); ChartPanel DP = new ChartPanel(jfreechart); DP.setPreferredSize(new Dimension(TempThermoPanel.getWidth(), TempThermoPanel.getHeight())); TempThermoPanel.setLayout(new java.awt.BorderLayout()); TempThermoPanel.add(DP); TempThermoPanel.validate(); }