本文整理汇总了Java中org.jfree.chart.JFreeChart.DEFAULT_TITLE_FONT属性的典型用法代码示例。如果您正苦于以下问题:Java JFreeChart.DEFAULT_TITLE_FONT属性的具体用法?Java JFreeChart.DEFAULT_TITLE_FONT怎么用?Java JFreeChart.DEFAULT_TITLE_FONT使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类org.jfree.chart.JFreeChart
的用法示例。
在下文中一共展示了JFreeChart.DEFAULT_TITLE_FONT属性的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: raster
public void raster(Collection<Spike> spikes,String title)
{
CombinedDomainXYPlot plot = new CombinedDomainXYPlot(new NumberAxis("Time"));
// Build a plot for each layer
for (int i=0; i<net.nLayers(); i++)
plot.add(layerRaster(spikes,net.lay(i)),1);
JFreeChart chart= new JFreeChart("Raster: "+title,JFreeChart.DEFAULT_TITLE_FONT, plot,true);
// Put it in a frame!
JFrame fr=new JFrame();
fr.getContentPane().add(new ChartPanel(chart));
fr.setSize(1200,1000);
fr.setVisible(true);
}
示例2: createCandlestickChart
private JFreeChart createCandlestickChart(OHLCDataset priceOHLCDataset) {
final String title = "Chart";
final ValueAxis timeAxis = new DateAxis("Date");
final NumberAxis valueAxis = new NumberAxis("Price");
valueAxis.setAutoRangeIncludesZero(false);
valueAxis.setUpperMargin(0.0);
valueAxis.setLowerMargin(0.0);
XYPlot plot = new XYPlot(priceOHLCDataset, timeAxis, valueAxis, null);
final CandlestickRenderer candlestickRenderer = new CandlestickRenderer();
plot.setRenderer(candlestickRenderer);
//plot.getRangeAxis().setAutoRange(true);
// Give good width when zoom in, but too slow in calculation.
((CandlestickRenderer)plot.getRenderer()).setAutoWidthMethod(CandlestickRenderer.WIDTHMETHOD_SMALLEST);
CombinedDomainXYPlot cplot = new CombinedDomainXYPlot(timeAxis);
cplot.add(plot, 3);
cplot.setGap(8.0);
JFreeChart chart = new JFreeChart(title, JFreeChart.DEFAULT_TITLE_FONT, cplot, true);
applyChartTheme(chart);
// Handle zooming event.
chart.addChangeListener(this.getChartChangeListner());
return chart;
}
示例3: plotEvents
/** Plot a list of events read from a file */
public static void plotEvents(Queue<Spike> evts)
{
Iterator<Spike> itr=evts.iterator();
XYSeries data=new XYSeries("Size");
for (int i=0; i<evts.size(); i++)
{ Spike ev=itr.next();
data.add((float)ev.time,ev.addr);
}
XYDataset raster = new XYSeriesCollection(data);
XYDotRenderer renderer = new XYDotRenderer();
renderer.setDotWidth(2);
renderer.setDotHeight(2);
XYPlot subplot1 = new XYPlot(raster, null, new NumberAxis("address"), renderer);
XYPlot subplot2 = new XYPlot(raster, null, new NumberAxis("address"), renderer);
CombinedXYPlot plot = new CombinedXYPlot(new NumberAxis("Time"),new NumberAxis("Address"));
plot.add(subplot1, 1);
plot.add(subplot2, 1);
JFreeChart chart= new JFreeChart("Raster",JFreeChart.DEFAULT_TITLE_FONT, plot,true);
JFrame fr=new JFrame();
fr.getContentPane().add(new ChartPanel(chart));
fr.setSize(1200,1000);
fr.setVisible(true);
}
示例4: JThermometer
/**
* Default constructor.
*/
public JThermometer() {
super(new CardLayout());
this.plot.setInsets(new Insets(5, 5, 5, 5));
this.data = new DefaultValueDataset();
//data.setRange(new Double(-60000), new Double(60000));
this.plot.setDataset(this.data);
this.chart = new JFreeChart(null, JFreeChart.DEFAULT_TITLE_FONT, this.plot, false);
this.panel = new ChartPanel(this.chart);
add(this.panel, "Panel");
setBackground(getBackground());
}
示例5: JThermometer
/**
* Default constructor.
*/
public JThermometer() {
super(new CardLayout());
this.plot.setInsets(new RectangleInsets(5.0, 5.0, 5.0, 5.0));
this.data = new DefaultValueDataset();
this.plot.setDataset(this.data);
this.chart = new JFreeChart(null, JFreeChart.DEFAULT_TITLE_FONT,
this.plot, false);
this.panel = new ChartPanel(this.chart);
add(this.panel, "Panel");
setBackground(getBackground());
}
示例6: createChart
private JFreeChart createChart() {
final CombinedDomainXYPlot plot = new CombinedDomainXYPlot(new DateAxis("Time"));
final XYLineAndShapeRenderer renderer = new XYLineAndShapeRenderer(true, false);
final ClusteredXYBarRenderer barRenderer = new ClusteredXYBarRenderer();
final GradientPaint black = new GradientPaint(0.0f, 0.0f, Color.black, 0.0f, 0.0f, Color.black);
final TimeSeries seriests = new TimeSeries("Series");
final TimeSeries seasonalts = new TimeSeries("Seasonal");
final TimeSeries trendts = new TimeSeries("Trend");
final TimeSeries remainderts = new TimeSeries("Remainder");
final TimeSeries[] tsArray = new TimeSeries[]{seriests, seasonalts, trendts};
final String[] labels = new String[]{"Series", "Seasonal", "Trend"};
for (int i = 0; i < series.length; i++) {
final Date d = new Date((long) times[i]);
RegularTimePeriod rtp = RegularTimePeriod.createInstance(this.timePeriod, d, TimeZone.getDefault());
seriests.addOrUpdate(rtp, series[i]);
seasonalts.addOrUpdate(rtp, seasonal[i]);
trendts.addOrUpdate(rtp, trend[i]);
remainderts.addOrUpdate(rtp, remainder[i]);
}
plot.setGap(10.0);
renderer.setSeriesPaint(0, black);
barRenderer.setSeriesPaint(0, black);
plot.setOrientation(PlotOrientation.VERTICAL);
for (int i = 0; i < tsArray.length; i++) {
final XYDataset ts = new TimeSeriesCollection(tsArray[i]);
final XYPlot p = new XYPlot(ts, new DateAxis(labels[i]), new NumberAxis(labels[i]), renderer);
plot.add(p);
}
final XYDataset rts = new TimeSeriesCollection(remainderts);
final XYDataset sts = new TimeSeriesCollection(seriests);
final XYDataset tts = new TimeSeriesCollection(trendts);
final XYPlot rplot = new XYPlot(rts, new DateAxis(), new NumberAxis("Remainder"), barRenderer);
final XYPlot seriesAndTrend = new XYPlot(sts, new DateAxis(), new NumberAxis("S & T"), renderer);
seriesAndTrend.setDataset(1, tts);
seriesAndTrend.setRenderer(1, renderer);
plot.add(rplot);
plot.add(seriesAndTrend);
return new JFreeChart(this.title, JFreeChart.DEFAULT_TITLE_FONT, plot, true);
}
示例7: createCombinedChart
/**
* Creates an overlaid chart.
*
* @return The chart.
*/
private static JFreeChart createCombinedChart() {
// create plot ...
IntervalXYDataset data1 = createDataset1();
XYItemRenderer renderer1 = new XYLineAndShapeRenderer(true, false);
renderer1.setBaseToolTipGenerator(new StandardXYToolTipGenerator(
StandardXYToolTipGenerator.DEFAULT_TOOL_TIP_FORMAT,
new SimpleDateFormat("d-MMM-yyyy"), new DecimalFormat("0.00")));
renderer1.setSeriesStroke(0, new BasicStroke(4.0f,
BasicStroke.CAP_ROUND, BasicStroke.JOIN_BEVEL));
renderer1.setSeriesPaint(0, Color.blue);
DateAxis domainAxis = new DateAxis("Year");
domainAxis.setLowerMargin(0.0);
domainAxis.setUpperMargin(0.02);
ValueAxis rangeAxis = new NumberAxis("$billion");
XYPlot plot1 = new XYPlot(data1, null, rangeAxis, renderer1);
plot1.setBackgroundPaint(Color.lightGray);
plot1.setDomainGridlinePaint(Color.white);
plot1.setRangeGridlinePaint(Color.white);
// add a second dataset and renderer...
IntervalXYDataset data2 = createDataset2();
XYBarRenderer renderer2 = new XYBarRenderer() {
public Paint getItemPaint(int series, int item) {
XYDataset dataset = getPlot().getDataset();
if (dataset.getYValue(series, item) >= 0.0) {
return Color.red;
}
else {
return Color.green;
}
}
};
renderer2.setSeriesPaint(0, Color.red);
renderer2.setDrawBarOutline(false);
renderer2.setBaseToolTipGenerator(new StandardXYToolTipGenerator(
StandardXYToolTipGenerator.DEFAULT_TOOL_TIP_FORMAT,
new SimpleDateFormat("d-MMM-yyyy"), new DecimalFormat("0.00")));
XYPlot plot2 = new XYPlot(data2, null, new NumberAxis("$billion"),
renderer2);
plot2.setBackgroundPaint(Color.lightGray);
plot2.setDomainGridlinePaint(Color.white);
plot2.setRangeGridlinePaint(Color.white);
CombinedXYPlot cplot = new CombinedXYPlot(domainAxis, rangeAxis);
cplot.add(plot1, 3);
cplot.add(plot2, 2);
cplot.setGap(8.0);
cplot.setDomainGridlinePaint(Color.white);
cplot.setDomainGridlinesVisible(true);
// return a new chart containing the overlaid plot...
JFreeChart chart = new JFreeChart("CombinedXYPlotDemo1",
JFreeChart.DEFAULT_TITLE_FONT, cplot, false);
chart.setBackgroundPaint(Color.white);
LegendTitle legend = new LegendTitle(cplot);
chart.addSubtitle(legend);
return chart;
}
示例8: build
@Override
public final JFreeChartAdaptor build() {
final String tmpTitle = this.getTitle();
final Font tmpTitleFont = JFreeChart.DEFAULT_TITLE_FONT;
final Plot tmpPlot = this.makePlot(plot);
final boolean tmpLegend = this.isLegend();
final JFreeChart retVal = new JFreeChart(tmpTitle, tmpTitleFont, tmpPlot, tmpLegend);
retVal.setBackgroundPaint(this.getBackground());
retVal.setBorderVisible(this.isBorder());
return new JFreeChartAdaptor(retVal);
}