本文整理汇总了Java中org.jfree.chart.ChartTheme类的典型用法代码示例。如果您正苦于以下问题:Java ChartTheme类的具体用法?Java ChartTheme怎么用?Java ChartTheme使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ChartTheme类属于org.jfree.chart包,在下文中一共展示了ChartTheme类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: setDefaultChartFonts
import org.jfree.chart.ChartTheme; //导入依赖的package包/类
/**
* Changes the font of {@link JFreeChart}s to Sans Serif. This method uses a
* {@link StandardChartTheme} to do so, so any changes to the look of the chart must be done
* after calling this method.
*
* @param chart
* the chart to change fonts for
*/
protected static void setDefaultChartFonts(JFreeChart chart) {
final ChartTheme chartTheme = StandardChartTheme.createJFreeTheme();
if (StandardChartTheme.class.isAssignableFrom(chartTheme.getClass())) {
StandardChartTheme standardTheme = (StandardChartTheme) chartTheme;
// The default font used by JFreeChart cannot render japanese etc symbols
final Font oldExtraLargeFont = standardTheme.getExtraLargeFont();
final Font oldLargeFont = standardTheme.getLargeFont();
final Font oldRegularFont = standardTheme.getRegularFont();
final Font oldSmallFont = standardTheme.getSmallFont();
final Font extraLargeFont = new Font(Font.SANS_SERIF, oldExtraLargeFont.getStyle(), oldExtraLargeFont.getSize());
final Font largeFont = new Font(Font.SANS_SERIF, oldLargeFont.getStyle(), oldLargeFont.getSize());
final Font regularFont = new Font(Font.SANS_SERIF, oldRegularFont.getStyle(), oldRegularFont.getSize());
final Font smallFont = new Font(Font.SANS_SERIF, oldSmallFont.getStyle(), oldSmallFont.getSize());
standardTheme.setExtraLargeFont(extraLargeFont);
standardTheme.setLargeFont(largeFont);
standardTheme.setRegularFont(regularFont);
standardTheme.setSmallFont(smallFont);
standardTheme.apply(chart);
}
}
开发者ID:transwarpio,项目名称:rapidminer,代码行数:33,代码来源:AbstractAttributeStatisticsModel.java
示例2: setDefaultChartFonts
import org.jfree.chart.ChartTheme; //导入依赖的package包/类
/**
* Changes the font of {@link JFreeChart}s to Sans Serif. This method uses a
* {@link StandardChartTheme} to do so, so any changes to the look of the chart must be done
* after calling this method.
*
* @param chart
* the chart to change fonts for
*/
protected static void setDefaultChartFonts(JFreeChart chart) {
final ChartTheme chartTheme = StandardChartTheme.createJFreeTheme();
if (StandardChartTheme.class.isAssignableFrom(chartTheme.getClass())) {
StandardChartTheme standardTheme = (StandardChartTheme) chartTheme;
// The default font used by JFreeChart cannot render japanese etc symbols
final Font oldExtraLargeFont = standardTheme.getExtraLargeFont();
final Font oldLargeFont = standardTheme.getLargeFont();
final Font oldRegularFont = standardTheme.getRegularFont();
final Font oldSmallFont = standardTheme.getSmallFont();
final Font extraLargeFont = FontTools.getFont(Font.SANS_SERIF, oldExtraLargeFont.getStyle(),
oldExtraLargeFont.getSize());
final Font largeFont = FontTools.getFont(Font.SANS_SERIF, oldLargeFont.getStyle(), oldLargeFont.getSize());
final Font regularFont = FontTools.getFont(Font.SANS_SERIF, oldRegularFont.getStyle(), oldRegularFont.getSize());
final Font smallFont = FontTools.getFont(Font.SANS_SERIF, oldSmallFont.getStyle(), oldSmallFont.getSize());
standardTheme.setExtraLargeFont(extraLargeFont);
standardTheme.setLargeFont(largeFont);
standardTheme.setRegularFont(regularFont);
standardTheme.setSmallFont(smallFont);
standardTheme.apply(chart);
}
}
开发者ID:rapidminer,项目名称:rapidminer-studio,代码行数:34,代码来源:AbstractAttributeStatisticsModel.java
示例3: createPolarPlot
import org.jfree.chart.ChartTheme; //导入依赖的package包/类
/**
* Creates a sample chart.
*
* @param dataset the dataset.
*
* @return A sample chart.
*/
private JFreeChart createPolarPlot(final XYDataset dataset)
{
final JFreeChart chart = ChartFactory.createPolarChart(
"Satellite Locations",
dataset,
false, //lengend
true, // tooltips
false // url
);
final PolarPlot plot = (PolarPlot) chart.getPlot();
chart.setBackgroundPaint(new Color(220,220,220));
ChartTheme dark = StandardChartTheme.createDarknessTheme();
dark.apply(chart);
plot.setOutlinePaint(Color.BLACK);
//final DefaultPolarItemRenderer renderer = (DefaultPolarItemRenderer) plot.getRenderer();
// set renderer - using my custom one
SctterPlotItemGPSRenderer rend = new SctterPlotItemGPSRenderer();
plot.setRenderer(rend);
// set horizon = 0-90
ValueAxis axis = plot.getAxis();
axis.setRange(0.0,90.0);
// set tick spacing
//axis.getRange().
//axis.setAutoTickUnitSelection(false);
//axis.setAutoRangeMinimumSize(3);
TickUnits tu = new TickUnits();
tu.add( new NumberTickUnit(15));
axis.setStandardTickUnits( tu );
return chart;
}
开发者ID:FracturedPlane,项目名称:GpsdInspector,代码行数:45,代码来源:GpsInspector.java
示例4: TopNChartTableBuilder
import org.jfree.chart.ChartTheme; //导入依赖的package包/类
public TopNChartTableBuilder() {
ChartTheme chartTheme = new StandardChartTheme("sansserif");
ChartFactory.setChartTheme(chartTheme);
}
开发者ID:IARC-CSU,项目名称:CanReg5,代码行数:5,代码来源:TopNChartTableBuilder.java
示例5: CasesByAgeGroupChartTableBuilder
import org.jfree.chart.ChartTheme; //导入依赖的package包/类
public CasesByAgeGroupChartTableBuilder() {
ChartTheme chartTheme = new StandardChartTheme("sansserif");
ChartFactory.setChartTheme(chartTheme);
}
开发者ID:IARC-CSU,项目名称:CanReg5,代码行数:5,代码来源:CasesByAgeGroupChartTableBuilder.java
示例6: applyTheme
import org.jfree.chart.ChartTheme; //导入依赖的package包/类
private void applyTheme(int themeNum, JFreeChart chart)
{
switch(themeNum)
{
case DARK_THEME:
ChartTheme dark = StandardChartTheme.createDarknessTheme();
dark.apply(chart);
BarRenderer renderer = (BarRenderer) chart.getCategoryPlot().getRenderer();
chart.getPlot().setOutlinePaint(Color.DARK_GRAY);
renderer.setSeriesPaint(0, new Color(51, 102, 153));
break;
case LIGHT_THEME:
ChartTheme jfree = StandardChartTheme.createJFreeTheme();
jfree.apply(chart);
break;
case SHAWN_THEME:
jfree = StandardChartTheme.createJFreeTheme();
jfree.apply(chart);
Color lines = new Color(120,166,255);
// chart.getXYPlot().setBackgroundPaint(Color.WHITE);
// chart.getXYPlot().setDomainGridlinePaint(lines);
// chart.getXYPlot().setRangeGridlinePaint(lines);
// chart.getXYPlot().setDomainMinorGridlinesVisible(true);
// chart.getXYPlot().setDomainMinorGridlinePaint(lines);
// chart.getXYPlot().setRangeMinorGridlinePaint(lines);
chart.setBackgroundPaint(new Color(220,220,220));
// bar chart only
renderer = (BarRenderer) chart.getCategoryPlot().getRenderer();
// FINALLY a away to get rid of those stupid gradient lines on the bars
renderer.setBarPainter(new StandardBarPainter());
// renderer.setDrawBarOutline(false);
// final GradientPaint gp0 = new GradientPaint(
// 0.0f, 0.0f, Color.blue,
// 0.0f, 0.0f, Color.lightGray);
// renderer.setSeriesPaint(0, gp0);
renderer.setSeriesPaint(0, new Color(51, 102, 153));
renderer.setSeriesPaint(1, new Color(255, 0, 0));
renderer.setShadowVisible(false);
break;
}
}
开发者ID:FracturedPlane,项目名称:GpsdInspector,代码行数:55,代码来源:GpsInspector.java
注:本文中的org.jfree.chart.ChartTheme类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论