本文整理匯總了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);
}