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


Java IntervalCategoryItemLabelGenerator类代码示例

本文整理汇总了Java中org.jfree.chart.labels.IntervalCategoryItemLabelGenerator的典型用法代码示例。如果您正苦于以下问题:Java IntervalCategoryItemLabelGenerator类的具体用法?Java IntervalCategoryItemLabelGenerator怎么用?Java IntervalCategoryItemLabelGenerator使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: setAttribute

import org.jfree.chart.labels.IntervalCategoryItemLabelGenerator; //导入依赖的package包/类
private void setAttribute(JFreeChart chart) {
	// 圖案與文字的間隔
	LegendTitle legend = chart.getLegend();
	legend.setBorder(1, 1, 1, 1);

	CategoryPlot plot = chart.getCategoryPlot();
	// 設定WorkItem的屬性
	CategoryAxis domainAxis = plot.getDomainAxis();
	domainAxis.setCategoryLabelPositions(CategoryLabelPositions.DOWN_45); // 字體角度
	domainAxis.setTickLabelFont(new Font("新細明體", Font.TRUETYPE_FONT, 12)); // 字體

	// 設定Date的屬性
	DateAxis da = (DateAxis) plot.getRangeAxis(0);
	setDateAxis(da);

	// 設定實體的顯示名稱
	CategoryItemRenderer render = plot.getRenderer(0);
	DateFormat format = new SimpleDateFormat("yyyy-MM-dd");
	CategoryItemLabelGenerator generator = new IntervalCategoryItemLabelGenerator(
			"{3} ~ {4}", format);
	render.setBaseItemLabelGenerator(generator);
	render.setBaseItemLabelPaint(Color.BLUE);
	render.setBaseItemLabelsVisible(true);
	render.setBaseItemLabelFont(new Font("黑體", Font.TRUETYPE_FONT, 8));
	render.setSeriesPaint(0, Color.RED);
}
 
开发者ID:ezScrum,项目名称:ezScrum,代码行数:27,代码来源:ScheduleReport.java

示例2: testCloning2

import org.jfree.chart.labels.IntervalCategoryItemLabelGenerator; //导入依赖的package包/类
/**
 * Confirm that cloning works.
 */
@Test
public void testCloning2() throws CloneNotSupportedException {
    BarRenderer r1 = new BarRenderer();
    r1.setBaseItemLabelGenerator(new IntervalCategoryItemLabelGenerator());
    BarRenderer r2 = (BarRenderer) r1.clone();

    assertTrue(r1 != r2);
    assertTrue(r1.getClass() == r2.getClass());
    assertTrue(r1.equals(r2));

    r1 = new BarRenderer();
    r1.setSeriesItemLabelGenerator(0,
            new IntervalCategoryItemLabelGenerator());
    r2 = (BarRenderer) r1.clone();
    assertTrue(r1 != r2);
    assertTrue(r1.getClass() == r2.getClass());
    assertTrue(r1.equals(r2));

    r1 = new BarRenderer();
    r1.setBaseItemLabelGenerator(new IntervalCategoryItemLabelGenerator());
    r2 = (BarRenderer) r1.clone();

    assertTrue(r1 != r2);
    assertTrue(r1.getClass() == r2.getClass());
    assertTrue(r1.equals(r2));
}
 
开发者ID:mdzio,项目名称:ccu-historian,代码行数:30,代码来源:AbstractCategoryItemRendererTest.java

示例3: testCloning2

import org.jfree.chart.labels.IntervalCategoryItemLabelGenerator; //导入依赖的package包/类
/**
 * Confirm that cloning works.
 */
@Test
public void testCloning2() throws CloneNotSupportedException {
    BarRenderer r1 = new BarRenderer();
    r1.setDefaultItemLabelGenerator(new IntervalCategoryItemLabelGenerator());
    BarRenderer r2 = (BarRenderer) r1.clone();

    assertTrue(r1 != r2);
    assertTrue(r1.getClass() == r2.getClass());
    assertTrue(r1.equals(r2));

    r1 = new BarRenderer();
    r1.setSeriesItemLabelGenerator(0,
            new IntervalCategoryItemLabelGenerator());
    r2 = (BarRenderer) r1.clone();
    assertTrue(r1 != r2);
    assertTrue(r1.getClass() == r2.getClass());
    assertTrue(r1.equals(r2));

    r1 = new BarRenderer();
    r1.setDefaultItemLabelGenerator(new IntervalCategoryItemLabelGenerator());
    r2 = (BarRenderer) r1.clone();

    assertTrue(r1 != r2);
    assertTrue(r1.getClass() == r2.getClass());
    assertTrue(r1.equals(r2));
}
 
开发者ID:jfree,项目名称:jfreechart,代码行数:30,代码来源:AbstractCategoryItemRendererTest.java

示例4: testHashCode

import org.jfree.chart.labels.IntervalCategoryItemLabelGenerator; //导入依赖的package包/类
/**
 * Simple check that hashCode is implemented.
 */
public void testHashCode() {
    IntervalCategoryItemLabelGenerator g1
            = new IntervalCategoryItemLabelGenerator();
    IntervalCategoryItemLabelGenerator g2
            = new IntervalCategoryItemLabelGenerator();
    assertTrue(g1.equals(g2));
    assertTrue(g1.hashCode() == g2.hashCode());
}
 
开发者ID:SpoonLabs,项目名称:astor,代码行数:12,代码来源:IntervalCategoryItemLabelGeneratorTests.java

示例5: testPublicCloneable

import org.jfree.chart.labels.IntervalCategoryItemLabelGenerator; //导入依赖的package包/类
/**
 * Check to ensure that this class implements PublicCloneable.
 */
public void testPublicCloneable() {
    IntervalCategoryItemLabelGenerator g1
            = new IntervalCategoryItemLabelGenerator();
    assertTrue(g1 instanceof PublicCloneable);
}
 
开发者ID:SpoonLabs,项目名称:astor,代码行数:9,代码来源:IntervalCategoryItemLabelGeneratorTests.java


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