本文整理了Java中org.jfree.chart.JFreeChart.addSubtitle()
方法的一些代码示例,展示了JFreeChart.addSubtitle()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。JFreeChart.addSubtitle()
方法的具体详情如下:
包路径:org.jfree.chart.JFreeChart
类名称:JFreeChart
方法名:addSubtitle
[英]Adds a subtitle at a particular position in the subtitle list, and sends a ChartChangeEvent to all registered listeners.
[中]在字幕列表中的特定位置添加字幕,并向所有注册的侦听器发送ChartChangeEvent。
代码示例来源:origin: jfree/jfreechart
/**
* Adds a legend to the plot and sends a {@link ChartChangeEvent} to all
* registered listeners.
*
* @param legend the legend ({@code null} not permitted).
*
* @see #removeLegend()
*/
public void addLegend(LegendTitle legend) {
addSubtitle(legend);
}
代码示例来源:origin: org.codehaus.jtstand/jtstand-chart
/**
* Adds a legend to the plot and sends a {@link ChartChangeEvent} to all
* registered listeners.
*
* @param legend the legend (<code>null</code> not permitted).
*
* @see #removeLegend()
*/
public void addLegend(LegendTitle legend) {
addSubtitle(legend);
}
代码示例来源:origin: org.codehaus.jtstand/jtstand-chart
/**
* Adds a subtitle to the chart.
*
* @param subtitle the subtitle.
*/
public void addSubtitle(Title subtitle) {
this.chart.addSubtitle(subtitle);
}
代码示例来源:origin: stackoverflow.com
private void createChart(XYPlot plot, String fileName, String caption) throws IOException {
JFreeChart chart = new JFreeChart(caption, plot);
chart.addSubtitle(this.subtitle);
if (plot.getRangeAxis() instanceof LogarithmicAxis) {
chart.addSubtitle(1, new TextTitle("(logarithmische Skala)"));
}
File file = new File(fileName);
file.delete();
ChartUtilities.saveChartAsPNG(file, chart, CHART_WIDTH, CHART_HEIGHT);
}
代码示例来源:origin: org.codehaus.jtstand/jtstand-chart
/**
* Adds a subtitle to the chart.
*
* @param subtitle the subtitle.
*/
public void addSubtitle(String subtitle) {
this.chart.addSubtitle(new TextTitle(subtitle));
}
代码示例来源:origin: org.codehaus.jtstand/jtstand-chart
/**
* Adds a subtitle to the chart.
*
* @param subtitle the subtitle.
* @param font the subtitle font.
*/
public void addSubtitle(String subtitle, Font font) {
this.chart.addSubtitle(new TextTitle(subtitle, font));
}
代码示例来源:origin: lessthanoptimal/Java-Matrix-Benchmark
public void setSubTitle( String title ) {
chart.addSubtitle(new TextTitle(title,new Font("SansSerif", Font.ITALIC, 12)));
}
代码示例来源:origin: matsim-org/matsim
/**
* Adds the MATSim Logo in the lower right corner of the chart.
*/
public void addMatsimLogo() {
try {
Image image = MatsimResource.getAsImage("matsim_logo_transparent_small.png");
Title subtitle = new ImageTitle(image, RectangleEdge.BOTTOM, HorizontalAlignment.RIGHT, VerticalAlignment.BOTTOM);
this.chart.addSubtitle(subtitle);
} catch ( Exception e ) {
e.printStackTrace() ;
// I just had a resource-not-found error inside the method; don't know what that means but does not feel like a reason
// to not continue. kai, apr'30
}
}
代码示例来源:origin: lessthanoptimal/Java-Matrix-Benchmark
public MemoryRelativeBarPlot( String title ) {
chart = ChartFactory.createBarChart(
title, // chart title
"Operation", // domain axis label
"Relative Memory", // range axis label
dataset, // data
PlotOrientation.VERTICAL, // orientation
true, // include legend
true, // tooltips?
false // URLs?
);
chart.addSubtitle(new TextTitle("(Smaller is Better)",new Font("SansSerif", Font.ITALIC, 12)));
plot();
}
代码示例来源:origin: OpenNMS/opennms
/**
* @param chartConfig
* @param barChart
*/
private static void addSubTitles(BarChart chartConfig, JFreeChart barChart) {
Iterator<SubTitle> it;
/*
* Add subtitles.
*/
for (it = chartConfig.getSubTitleCollection().iterator(); it.hasNext();) {
SubTitle subTitle = (SubTitle) it.next();
Title title = subTitle.getTitle();
String value = title.getValue();
barChart.addSubtitle(new TextTitle(value));
}
}
代码示例来源:origin: org.codehaus.jtstand/jtstand-chart
/**
* Sets the title list for the chart (completely replaces any existing
* titles) and sends a {@link ChartChangeEvent} to all registered
* listeners.
*
* @param subtitles the new list of subtitles (<code>null</code> not
* permitted).
*
* @see #getSubtitles()
*/
public void setSubtitles(List subtitles) {
if (subtitles == null) {
throw new NullPointerException("Null 'subtitles' argument.");
}
setNotify(false);
clearSubtitles();
Iterator iterator = subtitles.iterator();
while (iterator.hasNext()) {
Title t = (Title) iterator.next();
if (t != null) {
addSubtitle(t);
}
}
setNotify(true); // this fires a ChartChangeEvent
}
代码示例来源:origin: org.opennms/opennms-web-api
/**
* @param chartConfig
* @param barChart
*/
private static void addSubTitles(BarChart chartConfig, JFreeChart barChart) {
Iterator<SubTitle> it;
/*
* Add subtitles.
*/
for (it = chartConfig.getSubTitleCollection().iterator(); it.hasNext();) {
SubTitle subTitle = (SubTitle) it.next();
Title title = subTitle.getTitle();
String value = title.getValue();
barChart.addSubtitle(new TextTitle(value));
}
}
代码示例来源:origin: lessthanoptimal/Java-Matrix-Benchmark
public OverallRelativeAreaPlot(String title , int sizes[] ) {
// createAreaChart
chart = ChartFactory.createStackedAreaChart(
title, // chart title
"Size", // domain axis label
"Relative Average Speed", // range axis label
dataset, // data
PlotOrientation.VERTICAL, // orientation
true, // include legend
true,
false
);
chart.addSubtitle(new TextTitle("Weighted by Operation Speed. Larger is Better.",new Font("SansSerif", Font.ITALIC, 12)));
plot = chart.getCategoryPlot();
sizeNames = new String[sizes.length];
for( int i = 0; i < sizes.length; i++ ) {
sizeNames[i] = Integer.toString(sizes[i]);
}
plot.setRangeGridlinePaint(Color.WHITE);
plot.setBackgroundPaint(Color.WHITE);
plot.setDomainGridlinesVisible(true);
}
代码示例来源:origin: stackoverflow.com
compositeTitle.setVerticalAlignment(VerticalAlignment.CENTER);
chart.getTitle().setVisible(false);
chart.addSubtitle(compositeTitle);
代码示例来源:origin: lessthanoptimal/Java-Matrix-Benchmark
public JFreeChart createChart() {
JFreeChart chart = ChartFactory.createBoxAndWhiskerChart(
title, "Matrix Libraries", "Relative Performance", dataSet,
true);
CategoryPlot plot = chart.getCategoryPlot();
plot.setDomainGridlinesVisible(true);
plot.setBackgroundPaint(new Color(230,230,230));
plot.setDomainGridlinePaint(new Color(50,50,50,50));
plot.setDomainGridlineStroke(new BasicStroke(78f));
chart.getTitle().setFont(new Font("Times New Roman", Font.BOLD, 24));
String foo = "( Higher is Better )";
if( subtitle != null )
foo += " ( "+subtitle+" )";
chart.addSubtitle(new TextTitle(foo,new Font("SansSerif", Font.ITALIC, 12)));
NumberAxis rangeAxis = (NumberAxis) plot.getRangeAxis();
rangeAxis.setStandardTickUnits(NumberAxis.createIntegerTickUnits());
return chart;
}
代码示例来源:origin: jfree/jfreechart
/**
* Sets the title list for the chart (completely replaces any existing
* titles) and sends a {@link ChartChangeEvent} to all registered
* listeners.
*
* @param subtitles the new list of subtitles ({@code null} not
* permitted).
*
* @see #getSubtitles()
*/
public void setSubtitles(List<Title> subtitles) {
Args.nullNotPermitted(subtitles, "subtitles");
setNotify(false);
clearSubtitles();
for (Title t: subtitles) {
if (t != null) {
addSubtitle(t);
}
}
setNotify(true); // this fires a ChartChangeEvent
}
代码示例来源:origin: org.n52.series-api/io
private void addNotice(JFreeChart chart) {
TextTitle notice = new TextTitle();
String msg = i18n.get("msg.io.chart.notice");
if (msg != null && !msg.isEmpty()) {
notice.setText(msg);
notice.setPaint(Color.BLACK);
notice.setFont(LabelConstants.FONT_LABEL_SMALL);
notice.setPosition(RectangleEdge.BOTTOM);
notice.setHorizontalAlignment(HorizontalAlignment.RIGHT);
notice.setVerticalAlignment(VerticalAlignment.BOTTOM);
notice.setPadding(new RectangleInsets(0, 0, 20, 20));
chart.addSubtitle(notice);
}
}
代码示例来源:origin: org.n52.sensorweb/timeseries-io
private void addNotice(JFreeChart chart) {
TextTitle notice = new TextTitle();
String msg = i18n.get("notice");
if (msg != null && !msg.isEmpty()) {
notice.setText(msg);
notice.setPaint(BLACK);
notice.setFont(FONT_LABEL_SMALL);
notice.setPosition(RectangleEdge.BOTTOM);
notice.setHorizontalAlignment(HorizontalAlignment.RIGHT);
notice.setVerticalAlignment(VerticalAlignment.BOTTOM);
notice.setPadding(new RectangleInsets(0, 0, 20, 20));
chart.addSubtitle(notice);
}
}
代码示例来源:origin: dhis2/dhis2-core
/**
* Sets basic configuration including title font, subtitle, background paint and
* anti-alias on the given JFreeChart.
*/
private void setBasicConfig( JFreeChart jFreeChart, BaseChart chart)
{
jFreeChart.getTitle().setFont( TITLE_FONT );
jFreeChart.setBackgroundPaint( DEFAULT_BACKGROUND_COLOR );
jFreeChart.setAntiAlias( true );
if ( !chart.isHideTitle() )
{
jFreeChart.addSubtitle( getSubTitle( chart ) );
}
Plot plot = jFreeChart.getPlot();
plot.setBackgroundPaint( DEFAULT_BACKGROUND_COLOR );
plot.setOutlinePaint( DEFAULT_BACKGROUND_COLOR );
}
代码示例来源:origin: org.renci/charts
public JFreeChart createStackedAreaChart(String title, TableXYDataset dataset) {
DateAxis domainAxis = new DateAxis("Date");
domainAxis.setTickMarkPosition(DateTickMarkPosition.MIDDLE);
domainAxis.setLowerMargin(0.01);
domainAxis.setUpperMargin(0.01);
NumberAxis rangeAxis = new NumberAxis("Minutes");
rangeAxis.setStandardTickUnits(NumberAxis.createIntegerTickUnits());
rangeAxis.setUpperMargin(0.10);
StackedXYAreaRenderer2 renderer = new StackedXYAreaRenderer2();
renderer.setBaseItemLabelsVisible(true);
renderer.setBaseItemLabelGenerator(new StandardXYItemLabelGenerator());
renderer.setBasePositiveItemLabelPosition(new ItemLabelPosition(ItemLabelAnchor.OUTSIDE12,
TextAnchor.BOTTOM_CENTER));
renderer.setSeriesPaint(0, Color.lightGray);
XYPlot plot = new XYPlot(dataset, domainAxis, rangeAxis, renderer);
plot.setRenderer(0, renderer);
plot.setDomainCrosshairVisible(true);
plot.setRangeCrosshairVisible(true);
LegendTitle legend = new LegendTitle(plot);
legend.setBackgroundPaint(Color.white);
legend.setFrame(new BlockBorder());
legend.setPosition(RectangleEdge.BOTTOM);
JFreeChart chart = new JFreeChart(title, JFreeChart.DEFAULT_TITLE_FONT, plot, true);
chart.removeLegend();
chart.setTextAntiAlias(RenderingHints.VALUE_TEXT_ANTIALIAS_DEFAULT);
chart.addSubtitle(legend);
return chart;
}
内容来源于网络,如有侵权,请联系作者删除!