当前位置: 首页>>代码示例>>Java>>正文


Java StandardChartTheme.setRegularFont方法代码示例

本文整理汇总了Java中org.jfree.chart.StandardChartTheme.setRegularFont方法的典型用法代码示例。如果您正苦于以下问题:Java StandardChartTheme.setRegularFont方法的具体用法?Java StandardChartTheme.setRegularFont怎么用?Java StandardChartTheme.setRegularFont使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.jfree.chart.StandardChartTheme的用法示例。


在下文中一共展示了StandardChartTheme.setRegularFont方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: setDefaultChartFonts

import org.jfree.chart.StandardChartTheme; //导入方法依赖的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: applyChartTheme

import org.jfree.chart.StandardChartTheme; //导入方法依赖的package包/类
public void applyChartTheme() {
	final StandardChartTheme chartTheme = (StandardChartTheme) org.jfree.chart.StandardChartTheme
			.createJFreeTheme();

	final Font oldExtraLargeFont = chartTheme.getExtraLargeFont();
	final Font oldLargeFont = chartTheme.getLargeFont();
	final Font oldRegularFont = chartTheme.getRegularFont();
	final Font oldSmallFont = chartTheme.getSmallFont();

	final Font extraLargeFont = new Font("Sans-serif", oldExtraLargeFont.getStyle(), oldExtraLargeFont.getSize());
	final Font largeFont = new Font("Sans-serif", oldLargeFont.getStyle(), oldLargeFont.getSize());
	final Font regularFont = new Font("Sans-serif", oldRegularFont.getStyle(), oldRegularFont.getSize());
	final Font smallFont = new Font("Sans-serif", oldSmallFont.getStyle(), oldSmallFont.getSize());

	chartTheme.setExtraLargeFont(extraLargeFont);
	chartTheme.setLargeFont(largeFont);
	chartTheme.setRegularFont(regularFont);
	chartTheme.setSmallFont(smallFont);

	chartTheme.apply(chart);
}
 
开发者ID:MyersResearchGroup,项目名称:iBioSim,代码行数:22,代码来源:GraphData.java

示例3: setDefaultChartFonts

import org.jfree.chart.StandardChartTheme; //导入方法依赖的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

示例4: initializeTheme

import org.jfree.chart.StandardChartTheme; //导入方法依赖的package包/类
public static StandardChartTheme initializeTheme() {
    String fontName = "Arial";
    StandardChartTheme theme = (StandardChartTheme) org.jfree.chart.StandardChartTheme.createJFreeTheme();
    theme.setExtraLargeFont(new Font(fontName, Font.PLAIN, 24)); // title
    theme.setLargeFont(new Font(fontName, Font.PLAIN, 20)); // axis-title
    theme.setRegularFont(new Font(fontName, Font.PLAIN, 16));
    theme.setSmallFont(new Font(fontName, Font.PLAIN, 12));
    theme.setRangeGridlinePaint(Color.decode("#C0C0C0"));
    theme.setPlotBackgroundPaint(Color.white);
    theme.setChartBackgroundPaint(Color.white);
    theme.setGridBandPaint(Color.red);
    theme.setAxisOffset(new RectangleInsets(0, 0, 0, 0));
    theme.setBarPainter(new StandardBarPainter());
    theme.setAxisLabelPaint(Color.decode("#666666"));
    return theme;
}
 
开发者ID:OWASP,项目名称:Benchmark,代码行数:17,代码来源:ScatterPlot.java

示例5: setChartTheme

import org.jfree.chart.StandardChartTheme; //导入方法依赖的package包/类
public static void setChartTheme() {
    StandardChartTheme chartTheme = new StandardChartTheme("CN");
    chartTheme.setExtraLargeFont(FONT);
    chartTheme.setRegularFont(FONT);
    chartTheme.setLargeFont(FONT);
    chartTheme.setSmallFont(FONT);
    chartTheme.setTitlePaint(new Color(51, 51, 51));
    chartTheme.setSubtitlePaint(new Color(85, 85, 85));

    chartTheme.setLegendBackgroundPaint(Color.WHITE);
    chartTheme.setLegendItemPaint(Color.BLACK);//
    chartTheme.setChartBackgroundPaint(Color.WHITE);

    Paint[] OUTLINE_PAINT_SEQUENCE = new Paint[]{Color.WHITE};
    DefaultDrawingSupplier drawingSupplier = new DefaultDrawingSupplier(CHART_COLORS, CHART_COLORS, OUTLINE_PAINT_SEQUENCE,
            DefaultDrawingSupplier.DEFAULT_STROKE_SEQUENCE, DefaultDrawingSupplier.DEFAULT_OUTLINE_STROKE_SEQUENCE,
            DefaultDrawingSupplier.DEFAULT_SHAPE_SEQUENCE);
    chartTheme.setDrawingSupplier(drawingSupplier);

    chartTheme.setPlotBackgroundPaint(Color.WHITE);
    chartTheme.setPlotOutlinePaint(Color.WHITE);
    chartTheme.setLabelLinkPaint(new Color(8, 55, 114));
    chartTheme.setLabelLinkStyle(PieLabelLinkStyle.CUBIC_CURVE);

    chartTheme.setAxisOffset(new RectangleInsets(5, 12, 5, 12));
    chartTheme.setDomainGridlinePaint(new Color(192, 208, 224));
    chartTheme.setRangeGridlinePaint(new Color(192, 192, 192));

    chartTheme.setBaselinePaint(Color.WHITE);
    chartTheme.setCrosshairPaint(Color.BLUE);
    chartTheme.setAxisLabelPaint(new Color(51, 51, 51));
    chartTheme.setTickLabelPaint(new Color(67, 67, 72));
    chartTheme.setBarPainter(new StandardBarPainter());
    chartTheme.setXYBarPainter(new StandardXYBarPainter());

    chartTheme.setItemLabelPaint(Color.black);
    chartTheme.setThermometerPaint(Color.white);

    ChartFactory.setChartTheme(chartTheme);
}
 
开发者ID:Fanping,项目名称:iveely.ml,代码行数:41,代码来源:ChartUtils.java

示例6: createChart

import org.jfree.chart.StandardChartTheme; //导入方法依赖的package包/类
private JFreeChart createChart(String chartContent, String title, String yaxisName){
    //创建时序图对象
    XYSeries = new XYSeries(chartContent);
    XYSeriesCollection xySeriesCollection=new XYSeriesCollection(XYSeries);

    // 设置中文主题样式 解决乱码
    StandardChartTheme chartTheme = new StandardChartTheme("CN");
    // 设置标题字体
    chartTheme.setExtraLargeFont(font);
    // 设置图例的字体
    chartTheme.setRegularFont(font);
    // 设置轴向的字体
    chartTheme.setLargeFont(font);
    chartTheme.setSmallFont(font);

    ChartFactory.setChartTheme(chartTheme);

    JFreeChart jfreechart = ChartFactory.createXYLineChart(title,"帧数",yaxisName,xySeriesCollection);
    XYPlot xyplot = jfreechart.getXYPlot();
    //纵坐标设定
    ValueAxis valueaxis = xyplot.getDomainAxis();
    //自动设置数据轴数据范围
    valueaxis.setAutoRange(true);
    //数据轴固定数据范围 30s
    //valueaxis.setFixedAutoRange(100);

    valueaxis = xyplot.getRangeAxis();

    return jfreechart;
}
 
开发者ID:ZingBug,项目名称:NystagmusJava,代码行数:31,代码来源:WaveChart.java

示例7: getStandardChartTheme

import org.jfree.chart.StandardChartTheme; //导入方法依赖的package包/类
public StandardChartTheme getStandardChartTheme() {
	StandardChartTheme standardChartTheme = new StandardChartTheme("");
	standardChartTheme.setExtraLargeFont(new Font("微软雅黑", Font.PLAIN, 16));// 可以改变轴向的字体
	standardChartTheme.setRegularFont(new Font("微软雅黑", Font.PLAIN, 16));// 可以改变图例的字体
	standardChartTheme.setLargeFont(new Font("宋体", Font.PLAIN, 16)); // 可以改变图标的标题字体
	return standardChartTheme;
}
 
开发者ID:foryuki,项目名称:viewpark,代码行数:8,代码来源:ImageAction.java

示例8: notSoUglyPlease

import org.jfree.chart.StandardChartTheme; //导入方法依赖的package包/类
private static void notSoUglyPlease(JFreeChart chart) {
	String fontName = "Lucida Sans";

	StandardChartTheme theme = (StandardChartTheme)org.jfree.chart.StandardChartTheme.createJFreeTheme();

	theme.setTitlePaint( Color.decode("#4572a7") );
	theme.setExtraLargeFont(new Font(fontName, Font.BOLD, 14)); //title
	theme.setLargeFont(new Font(fontName, Font.BOLD, 15)); //axis-title
	theme.setRegularFont(new Font(fontName, Font.PLAIN, 11));
	theme.setRangeGridlinePaint(Color.decode("#C0C0C0"));
	theme.setPlotBackgroundPaint(Color.white);
	theme.setChartBackgroundPaint(Color.white);
	theme.setGridBandPaint(Color.red);
	theme.setAxisOffset(new RectangleInsets(0, 0, 0, 0));
	theme.setBarPainter(new StandardBarPainter());
	theme.setAxisLabelPaint(Color.decode("#666666"));
	theme.apply(chart);
	chart.getCategoryPlot().setOutlineVisible(false);
	chart.getCategoryPlot().getRangeAxis().setAxisLineVisible(false);
	chart.getCategoryPlot().getRangeAxis().setTickMarksVisible(false);
	chart.getCategoryPlot().setRangeGridlineStroke(new BasicStroke());
	chart.getCategoryPlot().getRangeAxis().setTickLabelPaint(Color.decode("#666666"));
	chart.getCategoryPlot().getDomainAxis().setTickLabelPaint(Color.decode("#666666"));
	chart.setTextAntiAlias(true);
	chart.setAntiAlias(true);
	BarRenderer rend = (BarRenderer) chart.getCategoryPlot().getRenderer();
	rend.setShadowVisible(true);
	rend.setShadowXOffset(2);
	rend.setShadowYOffset(0);
	rend.setShadowPaint(Color.decode("#C0C0C0"));
	rend.setMaximumBarWidth(0.1);
}
 
开发者ID:junkdog,项目名称:entity-system-benchmarks,代码行数:33,代码来源:ChartWriterFactory.java

示例9: changeFontSize

import org.jfree.chart.StandardChartTheme; //导入方法依赖的package包/类
/**
 * convenience method to make the value marker labels larger or smaller
 * 
 * @param up
 */
private void changeFontSize(final Boolean up)
{
  // are we making a change?
  final float change;
  if (up != null)
  {
    // sort out which direction we're changing
    if (up)
    {
      change = MARKER_STEP_SIZE;
    }
    else
    {
      change = -MARKER_STEP_SIZE;
    }

  }
  else
  {
    change = 0;
  }

  // do we have a default?
  final float curSize =
      Activator.getDefault().getPreferenceStore().getFloat(
          TimeBarPlot.CHART_FONT_SIZE_NODE);

  // trim to reasonable size
  final float sizeToUse = Math.max(9, curSize);

  // produce new size
  final float newVal = sizeToUse + change;

  // store the new size
  Activator.getDefault().getPreferenceStore().setValue(
      TimeBarPlot.CHART_FONT_SIZE_NODE, newVal);

  final float base = newVal;

  final StandardChartTheme theme =
      (StandardChartTheme) StandardChartTheme.createJFreeTheme();

  theme.setRegularFont(theme.getRegularFont().deriveFont(base * 1.0f));
  theme.setExtraLargeFont(theme.getExtraLargeFont().deriveFont(base * 1.4f));
  theme.setLargeFont(theme.getLargeFont().deriveFont(base * 1.2f));
  theme.setSmallFont(theme.getSmallFont().deriveFont(base * 0.8f));
  theme.setChartBackgroundPaint(Color.white);
  theme.setPlotBackgroundPaint(Color.white);
  theme.setGridBandPaint(Color.lightGray);
  theme.setDomainGridlinePaint(Color.lightGray);
  theme.setRangeGridlinePaint(Color.lightGray);

  theme.apply(jFreeChart);
}
 
开发者ID:debrief,项目名称:limpet,代码行数:60,代码来源:StackedChartsView.java


注:本文中的org.jfree.chart.StandardChartTheme.setRegularFont方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。