• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java GanttRenderer类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: testEquals

import org.jfree.chart.renderer.category.GanttRenderer; //导入依赖的package包/类
/**
 * Check that the equals() method distinguishes all fields.
 */
public void testEquals() {
    GanttRenderer r1 = new GanttRenderer();
    GanttRenderer r2 = new GanttRenderer();
    assertEquals(r1, r2);
    
    r1.setCompletePaint(Color.yellow);
    assertFalse(r1.equals(r2));
    r2.setCompletePaint(Color.yellow);
    assertTrue(r1.equals(r2));
    
    r1.setIncompletePaint(Color.green);
    assertFalse(r1.equals(r2));
    r2.setIncompletePaint(Color.green);
    assertTrue(r1.equals(r2));

    r1.setStartPercent(0.11);
    assertFalse(r1.equals(r2));
    r2.setStartPercent(0.11);
    assertTrue(r1.equals(r2));

    r1.setEndPercent(0.88);
    assertFalse(r1.equals(r2));
    r2.setEndPercent(0.88);
    assertTrue(r1.equals(r2));
}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:29,代码来源:GanttRendererTests.java


示例2: testEquals

import org.jfree.chart.renderer.category.GanttRenderer; //导入依赖的package包/类
/**
 * Check that the equals() method distinguishes all fields.
 */
public void testEquals() {
    GanttRenderer r1 = new GanttRenderer();
    GanttRenderer r2 = new GanttRenderer();
    assertEquals(r1, r2);

    r1.setCompletePaint(Color.yellow);
    assertFalse(r1.equals(r2));
    r2.setCompletePaint(Color.yellow);
    assertTrue(r1.equals(r2));

    r1.setIncompletePaint(Color.green);
    assertFalse(r1.equals(r2));
    r2.setIncompletePaint(Color.green);
    assertTrue(r1.equals(r2));

    r1.setStartPercent(0.11);
    assertFalse(r1.equals(r2));
    r2.setStartPercent(0.11);
    assertTrue(r1.equals(r2));

    r1.setEndPercent(0.88);
    assertFalse(r1.equals(r2));
    r2.setEndPercent(0.88);
    assertTrue(r1.equals(r2));
}
 
开发者ID:SpoonLabs,项目名称:astor,代码行数:29,代码来源:GanttRendererTests.java


示例3: createGanttChart

import org.jfree.chart.renderer.category.GanttRenderer; //导入依赖的package包/类
/**
 * Creates a Gantt chart using the supplied attributes plus default values
 * where required.  The chart object returned by this method uses a
 * {@link CategoryPlot} instance as the plot, with a {@link CategoryAxis}
 * for the domain axis, a {@link DateAxis} as the range axis, and a
 * {@link GanttRenderer} as the renderer.
 *
 * @param title  the chart title (<code>null</code> permitted).
 * @param categoryAxisLabel  the label for the category axis
 *                           (<code>null</code> permitted).
 * @param dateAxisLabel  the label for the date axis
 *                       (<code>null</code> permitted).
 * @param dataset  the dataset for the chart (<code>null</code> permitted).
 * @param legend  a flag specifying whether or not a legend is required.
 *
 * @return A Gantt chart.
 */
public static JFreeChart createGanttChart(String title,
        String categoryAxisLabel, String dateAxisLabel,
        IntervalCategoryDataset dataset, boolean legend) {

    CategoryAxis categoryAxis = new CategoryAxis(categoryAxisLabel);
    DateAxis dateAxis = new DateAxis(dateAxisLabel);
    CategoryItemRenderer renderer = new GanttRenderer();
    renderer.setBaseToolTipGenerator(
                new IntervalCategoryToolTipGenerator(
                "{3} - {4}", DateFormat.getDateInstance()));
    CategoryPlot plot = new CategoryPlot(dataset, categoryAxis, dateAxis,
            renderer);
    plot.setOrientation(PlotOrientation.HORIZONTAL);
    JFreeChart chart = new JFreeChart(title, JFreeChart.DEFAULT_TITLE_FONT,
            plot, legend);
    currentTheme.apply(chart);
    return chart;

}
 
开发者ID:SpoonLabs,项目名称:astor,代码行数:37,代码来源:ChartFactory.java


示例4: createGanttChart

import org.jfree.chart.renderer.category.GanttRenderer; //导入依赖的package包/类
/**
 * Creates a Gantt chart using the supplied attributes plus default values where required.
 * <P>
 * The chart object returned by this method uses a {@link CategoryPlot} instance as the
 * plot, with a {@link CategoryAxis} for the domain axis, a {@link DateAxis} as the
 * range axis, and a {@link GanttRenderer} as the renderer.
 *
 * @param title  the chart title (<code>null</code> permitted).
 * @param categoryAxisLabel  the label for the category axis (<code>null</code> permitted).
 * @param dateAxisLabel  the label for the date axis (<code>null</code> permitted).
 * @param dataset  the dataset for the chart (<code>null</code> permitted).
 * @param legend  a flag specifying whether or not a legend is required.
 * @param tooltips  configure chart to generate tool tips?
 * @param urls  configure chart to generate URLs?
 *
 * @return A Gantt chart.
 */
public static JFreeChart createGanttChart(String title,
                                          String categoryAxisLabel,
                                          String dateAxisLabel,
                                          IntervalCategoryDataset dataset,
                                          boolean legend,
                                          boolean tooltips,
                                          boolean urls) {

    CategoryAxis categoryAxis = new CategoryAxis(categoryAxisLabel);
    DateAxis dateAxis = new DateAxis(dateAxisLabel);

    CategoryItemRenderer renderer = new GanttRenderer();
    if (tooltips) {
        renderer.setToolTipGenerator(
            new IntervalCategoryToolTipGenerator("{3} - {4}", DateFormat.getDateInstance())
        );
    }
    if (urls) {
        renderer.setItemURLGenerator(new StandardCategoryURLGenerator());
    }

    CategoryPlot plot = new CategoryPlot(dataset, categoryAxis, dateAxis, renderer);
    plot.setOrientation(PlotOrientation.HORIZONTAL);
    JFreeChart chart = new JFreeChart(title, JFreeChart.DEFAULT_TITLE_FONT, plot, legend);

    return chart;

}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:46,代码来源:ChartFactory.java


示例5: testEquals

import org.jfree.chart.renderer.category.GanttRenderer; //导入依赖的package包/类
/**
 * Problem that the equals(...) method distinguishes all fields.
 */
public void testEquals() {
    GanttRenderer r1 = new GanttRenderer();
    GanttRenderer r2 = new GanttRenderer();
    assertEquals(r1, r2);

}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:10,代码来源:GanttRendererTests.java


示例6: testHashcode

import org.jfree.chart.renderer.category.GanttRenderer; //导入依赖的package包/类
/**
 * Two objects that are equal are required to return the same hashCode. 
 */
public void testHashcode() {
    GanttRenderer r1 = new GanttRenderer();
    GanttRenderer r2 = new GanttRenderer();
    assertTrue(r1.equals(r2));
    int h1 = r1.hashCode();
    int h2 = r2.hashCode();
    assertEquals(h1, h2);
}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:12,代码来源:GanttRendererTests.java


示例7: createGanttChart

import org.jfree.chart.renderer.category.GanttRenderer; //导入依赖的package包/类
/**
 * Creates a Gantt chart using the supplied attributes plus default values 
 * where required.  The chart object returned by this method uses a 
 * {@link CategoryPlot} instance as the plot, with a {@link CategoryAxis} 
 * for the domain axis, a {@link DateAxis} as the range axis, and a 
 * {@link GanttRenderer} as the renderer.
 *
 * @param title  the chart title (<code>null</code> permitted).
 * @param categoryAxisLabel  the label for the category axis 
 *                           (<code>null</code> permitted).
 * @param dateAxisLabel  the label for the date axis 
 *                       (<code>null</code> permitted).
 * @param dataset  the dataset for the chart (<code>null</code> permitted).
 * @param legend  a flag specifying whether or not a legend is required.
 * @param tooltips  configure chart to generate tool tips?
 * @param urls  configure chart to generate URLs?
 *
 * @return A Gantt chart.
 */
public static JFreeChart createGanttChart(String title,
                                          String categoryAxisLabel,
                                          String dateAxisLabel,
                                          IntervalCategoryDataset dataset,
                                          boolean legend,
                                          boolean tooltips,
                                          boolean urls) {

    CategoryAxis categoryAxis = new CategoryAxis(categoryAxisLabel);
    DateAxis dateAxis = new DateAxis(dateAxisLabel);

    CategoryItemRenderer renderer = new GanttRenderer();
    if (tooltips) {
        renderer.setBaseToolTipGenerator(
                new IntervalCategoryToolTipGenerator(
                "{3} - {4}", DateFormat.getDateInstance()));
    }
    if (urls) {
        renderer.setBaseItemURLGenerator(
                new StandardCategoryURLGenerator());
    }

    CategoryPlot plot = new CategoryPlot(dataset, categoryAxis, dateAxis, 
            renderer);
    plot.setOrientation(PlotOrientation.HORIZONTAL);
    JFreeChart chart = new JFreeChart(title, JFreeChart.DEFAULT_TITLE_FONT,
            plot, legend);

    return chart;

}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:51,代码来源:ChartFactory.java


示例8: createGanttChart

import org.jfree.chart.renderer.category.GanttRenderer; //导入依赖的package包/类
/**
 * Creates a Gantt chart using the supplied attributes plus default values
 * where required.  The chart object returned by this method uses a
 * {@link CategoryPlot} instance as the plot, with a {@link CategoryAxis}
 * for the domain axis, a {@link DateAxis} as the range axis, and a
 * {@link GanttRenderer} as the renderer.
 *
 * @param title  the chart title (<code>null</code> permitted).
 * @param categoryAxisLabel  the label for the category axis
 *                           (<code>null</code> permitted).
 * @param dateAxisLabel  the label for the date axis
 *                       (<code>null</code> permitted).
 * @param dataset  the dataset for the chart (<code>null</code> permitted).
 * @param legend  a flag specifying whether or not a legend is required.
 * @param tooltips  configure chart to generate tool tips?
 * @param urls  configure chart to generate URLs?
 *
 * @return A Gantt chart.
 */
public static JFreeChart createGanttChart(String title,
        String categoryAxisLabel, String dateAxisLabel,
        IntervalCategoryDataset dataset, boolean legend, boolean tooltips,
        boolean urls) {

    CategoryAxis categoryAxis = new CategoryAxis(categoryAxisLabel);
    DateAxis dateAxis = new DateAxis(dateAxisLabel);

    CategoryItemRenderer renderer = new GanttRenderer();
    if (tooltips) {
        renderer.setBaseToolTipGenerator(
                new IntervalCategoryToolTipGenerator(
                "{3} - {4}", DateFormat.getDateInstance()));
    }
    if (urls) {
        renderer.setBaseItemURLGenerator(
                new StandardCategoryURLGenerator());
    }

    CategoryPlot plot = new CategoryPlot(dataset, categoryAxis, dateAxis,
            renderer);
    plot.setOrientation(PlotOrientation.HORIZONTAL);
    JFreeChart chart = new JFreeChart(title, JFreeChart.DEFAULT_TITLE_FONT,
            plot, legend);
    currentTheme.apply(chart);
    return chart;

}
 
开发者ID:mdzio,项目名称:ccu-historian,代码行数:48,代码来源:ChartFactory.java


示例9: createGanttChart

import org.jfree.chart.renderer.category.GanttRenderer; //导入依赖的package包/类
/**
 * Creates a Gantt chart using the supplied attributes plus default values
 * where required.  The chart object returned by this method uses a
 * {@link CategoryPlot} instance as the plot, with a {@link CategoryAxis}
 * for the domain axis, a {@link DateAxis} as the range axis, and a
 * {@link GanttRenderer} as the renderer.
 *
 * @param title  the chart title ({@code null} permitted).
 * @param categoryAxisLabel  the label for the category axis
 *                           ({@code null} permitted).
 * @param dateAxisLabel  the label for the date axis
 *                       ({@code null} permitted).
 * @param dataset  the dataset for the chart ({@code null} permitted).
 * @param legend  a flag specifying whether or not a legend is required.
 * @param tooltips  configure chart to generate tool tips?
 * @param urls  configure chart to generate URLs?
 *
 * @return A Gantt chart.
 */
public static JFreeChart createGanttChart(String title,
        String categoryAxisLabel, String dateAxisLabel,
        IntervalCategoryDataset dataset, boolean legend, boolean tooltips,
        boolean urls) {

    CategoryAxis categoryAxis = new CategoryAxis(categoryAxisLabel);
    DateAxis dateAxis = new DateAxis(dateAxisLabel);

    CategoryItemRenderer renderer = new GanttRenderer();
    if (tooltips) {
        renderer.setDefaultToolTipGenerator(
                new IntervalCategoryToolTipGenerator(
                "{3} - {4}", DateFormat.getDateInstance()));
    }
    if (urls) {
        renderer.setDefaultItemURLGenerator(
                new StandardCategoryURLGenerator());
    }

    CategoryPlot plot = new CategoryPlot(dataset, categoryAxis, dateAxis,
            renderer);
    plot.setOrientation(PlotOrientation.HORIZONTAL);
    JFreeChart chart = new JFreeChart(title, JFreeChart.DEFAULT_TITLE_FONT,
            plot, legend);
    currentTheme.apply(chart);
    return chart;

}
 
开发者ID:jfree,项目名称:jfreechart,代码行数:48,代码来源:ChartFactory.java


示例10: createGanttChart

import org.jfree.chart.renderer.category.GanttRenderer; //导入依赖的package包/类
/**
 * Creates a Gantt chart using the supplied attributes plus default values
 * where required.  The chart object returned by this method uses a
 * {@link CategoryPlot} instance as the plot, with a {@link CategoryAxis}
 * for the domain axis, a {@link DateAxis} as the range axis, and a
 * {@link GanttRenderer} as the renderer.
 *
 * @param title  the chart title (<code>null</code> permitted).
 * @param categoryAxisLabel  the label for the category axis
 *                           (<code>null</code> permitted).
 * @param dateAxisLabel  the label for the date axis
 *                       (<code>null</code> permitted).
 * @param dataset  the dataset for the chart (<code>null</code> permitted).
 * @param legend  a flag specifying whether or not a legend is required.
 * @param tooltips  configure chart to generate tool tips?
 * @param urls  configure chart to generate URLs?
 *
 * @return A Gantt chart.
 */
public static JFreeChart createGanttChart(String title,
                                          String categoryAxisLabel,
                                          String dateAxisLabel,
                                          IntervalCategoryDataset dataset,
                                          boolean legend,
                                          boolean tooltips,
                                          boolean urls) {

    CategoryAxis categoryAxis = new CategoryAxis(categoryAxisLabel);
    DateAxis dateAxis = new DateAxis(dateAxisLabel);

    CategoryItemRenderer renderer = new GanttRenderer();
    if (tooltips) {
        renderer.setBaseToolTipGenerator(
                new IntervalCategoryToolTipGenerator(
                "{3} - {4}", DateFormat.getDateInstance()));
    }
    if (urls) {
        renderer.setBaseItemURLGenerator(
                new StandardCategoryURLGenerator());
    }

    CategoryPlot plot = new CategoryPlot(dataset, categoryAxis, dateAxis,
            renderer);
    plot.setOrientation(PlotOrientation.HORIZONTAL);
    JFreeChart chart = new JFreeChart(title, JFreeChart.DEFAULT_TITLE_FONT,
            plot, legend);
    currentTheme.apply(chart);
    return chart;

}
 
开发者ID:SOCR,项目名称:HTML5_WebSite,代码行数:51,代码来源:ChartFactory.java


示例11: PlotActivityNetworkGantt

import org.jfree.chart.renderer.category.GanttRenderer; //导入依赖的package包/类
/**
 * Create a new Gantt JFrame
 * @param s {@link ActivityNetworkSolver} to be plotted as Gantt
 * @param selectedVariables {@link Vector} of {@link ActivityNetworkSolver}'s component names (variable names) that will be plotted.
 * @param n {@link JFrame} title
 */
public PlotActivityNetworkGantt(ActivityNetworkSolver s, Vector<String> selectedVariables, String n ) {
	super(n);
	this.solver = s;
	this.selectedVariables = selectedVariables;

	GanttRenderer renderer = new GanttRenderer();
	renderer.setBaseItemLabelFont(new Font("Tahoma", Font.PLAIN, 11));
	
	JFreeChart chart = ChartFactory.createGanttChart(null,// "Channel", //
			"Activities & Resources", // domain axis label
			null, // "Time", // range axis label
			createDataset(), // data
			false, // do not include legend
			false, // no tooltips
			false // urls
			);
	
	chart.getCategoryPlot().setRenderer(renderer);
	renderer.setSeriesPaint(0, Color.green.darker());
	renderer.setSeriesPaint(1, Color.red.darker());
	renderer.setItemMargin(-0.5);

	chart.getCategoryPlot().setRangeAxis(new NumberAxis());
	
	chart.getCategoryPlot().getRangeAxis().setLabelFont(new Font("Arial", Font.PLAIN, 14));
	chart.getCategoryPlot().getDomainAxis().setLabelFont(new Font("Arial", Font.PLAIN, 14));
	chart.getCategoryPlot().getDomainAxis().setTickLabelsVisible(true);
	chart.getCategoryPlot().getRangeAxis().setAutoRange(false);

	chartPanel = new ChartPanel(chart);
	chartPanel.setDomainZoomable(true);
	chartPanel.setRangeZoomable(true);

	setContentPane(new JScrollPane(chartPanel));
	this.setPreferredSize(new Dimension(800,600));
	this.setSize(new Dimension(800,600));
	this.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
	this.setVisible(true);
}
 
开发者ID:FedericoPecora,项目名称:meta-csp-framework,代码行数:46,代码来源:PlotActivityNetworkGantt.java


示例12: createChart

import org.jfree.chart.renderer.category.GanttRenderer; //导入依赖的package包/类
private JFreeChart createChart(IntervalCategoryDataset paramIntervalCategoryDataset) {
	JFreeChart localJFreeChart = ChartFactory.createGanttChart(I18N.getMsg("msg.chart.gantt.characters.title"), I18N.getMsg("msg.common.person"), I18N.getMsg("msg.common.date"), paramIntervalCategoryDataset, true, true, false);
	CategoryPlot localCategoryPlot = (CategoryPlot) localJFreeChart.getPlot();
	GanttRenderer localGanttRenderer = (GanttRenderer) localCategoryPlot.getRenderer();
	BookModel localDocumentModel = this.mainFrame.getBookModel();
	Session localSession = localDocumentModel.beginTransaction();
	SceneDAOImpl localSceneDAOImpl = new SceneDAOImpl(localSession);
	Date localDate1 = localSceneDAOImpl.findFirstDate();
	Date localDate2 = localSceneDAOImpl.findLastDate();
	localDocumentModel.commit();
	localCategoryPlot.addRangeMarker(ChartUtil.getDateIntervalMarker(localDate1, localDate2, I18N.getMsg("msg.chart.common.project.duration")), Layer.BACKGROUND);
	ChartUtil.setNiceSeriesColors(paramIntervalCategoryDataset, localGanttRenderer);
	return localJFreeChart;
}
 
开发者ID:markkohdev,项目名称:oStorybook,代码行数:15,代码来源:GanttChart.java


示例13: createChart

import org.jfree.chart.renderer.category.GanttRenderer; //导入依赖的package包/类
private JFreeChart createChart(IntervalCategoryDataset paramIntervalCategoryDataset) {
	JFreeChart localJFreeChart = ChartFactory.createGanttChart(this.chartTitle, this.domainAxisLabel, this.rangeAxisLabel, paramIntervalCategoryDataset, true, true, false);
	CategoryPlot localCategoryPlot = (CategoryPlot) localJFreeChart.getPlot();
	GanttRenderer localGanttRenderer = (GanttRenderer) localCategoryPlot.getRenderer();
	ChartUtil.hideLegend(localCategoryPlot);
	StandardCategoryItemLabelGenerator localStandardCategoryItemLabelGenerator = new StandardCategoryItemLabelGenerator();
	localGanttRenderer.setBaseItemLabelGenerator(localStandardCategoryItemLabelGenerator);
	localGanttRenderer.setBaseItemLabelsVisible(true);
	ItemLabelPosition localItemLabelPosition = new ItemLabelPosition(ItemLabelAnchor.CENTER, TextAnchor.CENTER);
	localGanttRenderer.setBasePositiveItemLabelPosition(localItemLabelPosition);
	ChartUtil.setNiceSeriesColors(paramIntervalCategoryDataset, localGanttRenderer);
	return localJFreeChart;
}
 
开发者ID:markkohdev,项目名称:oStorybook,代码行数:14,代码来源:PersonsByDateChart.java


示例14: testHashcode

import org.jfree.chart.renderer.category.GanttRenderer; //导入依赖的package包/类
/**
 * Two objects that are equal are required to return the same hashCode.
 */
public void testHashcode() {
    GanttRenderer r1 = new GanttRenderer();
    GanttRenderer r2 = new GanttRenderer();
    assertTrue(r1.equals(r2));
    int h1 = r1.hashCode();
    int h2 = r2.hashCode();
    assertEquals(h1, h2);
}
 
开发者ID:SpoonLabs,项目名称:astor,代码行数:12,代码来源:GanttRendererTests.java


示例15: test

import org.jfree.chart.renderer.category.GanttRenderer; //导入依赖的package包/类
@Override
public void test() {
	super.test();

	numberOfPagesTest(1);

	JFreeChart chart = getChart("summary.chart1", 0);
	CategoryPlot categoryPlot = chart.getCategoryPlot();
	Assert.assertEquals("renderer", GanttRenderer.class, categoryPlot.getRenderer().getClass());
	Assert.assertTrue("show labels", categoryPlot.getRenderer().getBaseItemLabelsVisible());
	Assert.assertFalse("show tick labels", categoryPlot.getDomainAxis().isTickMarksVisible());
	Assert.assertFalse("show tick marks", categoryPlot.getDomainAxis().isTickLabelsVisible());
	ganttChartDataTest(chart, "label", new String[] {"task1", "task2", "task3"}, new Object[][] {{toDate(2011, 1, 1), toDate(2011, 1, 8), 1d}, {toDate(2011, 1, 10), toDate(2011, 1, 15), 0.5d}, {toDate(2011, 1, 15), toDate(2011, 1, 25), 0.8d}});
	ganttChartDataTest(chart, "serie1", new String[] {"task1", "task2", "task3"}, new Object[][] {{toDate(2011, 1, 2), toDate(2011, 1, 9), null}, {toDate(2011, 1, 8), toDate(2011, 1, 14), null}, {toDate(2011, 1, 16), toDate(2011, 1, 20), null}});

	chart = getChart("summary.chart2", 0);
	Axis axis = chart.getCategoryPlot().getDomainAxis();
	Assert.assertEquals("task label", "task", axis.getLabel());
	Assert.assertEquals("task label color", Color.BLUE, axis.getLabelPaint());
	Assert.assertEquals("task label font", new Font("Arial", Font.BOLD, 10), axis.getLabelFont());
	Assert.assertEquals("tick label color", Color.CYAN, axis.getTickLabelPaint());
	Assert.assertEquals("tick label font", new Font("Arial", Font.ITALIC, 10), axis.getTickLabelFont());
	CategoryLabelPosition labelPosition = chart.getCategoryPlot().getDomainAxis().getCategoryLabelPositions().getLabelPosition(RectangleEdge.LEFT);
	Assert.assertEquals("plot label rotation", (45d / 180) * Math.PI, labelPosition.getAngle());
	Assert.assertEquals("line color", Color.LIGHT_GRAY, axis.getAxisLinePaint());

	chart = getChart("summary.chart3", 0);
	axis = chart.getCategoryPlot().getRangeAxis();
	Assert.assertEquals("time label", "time", axis.getLabel());
	Assert.assertEquals("time label color", Color.BLUE, axis.getLabelPaint());
	Assert.assertEquals("time label font", new Font("Arial", Font.BOLD, 10), axis.getLabelFont());
	Assert.assertEquals("tick label color", Color.CYAN, axis.getTickLabelPaint());
	Assert.assertEquals("tick label font", new Font("Arial", Font.ITALIC, 10), axis.getTickLabelFont());
	Assert.assertEquals("line color", Color.LIGHT_GRAY, axis.getAxisLinePaint());
}
 
开发者ID:svn2github,项目名称:dynamicreports-jasper,代码行数:36,代码来源:GanttChartTest.java


示例16: createGanttChart

import org.jfree.chart.renderer.category.GanttRenderer; //导入依赖的package包/类
/**
 *
 */
protected JFreeChart createGanttChart() throws JRException
{
	//FIXMECHART legend/tooltip/url should come from plot?
	
	ChartFactory.setChartTheme(StandardChartTheme.createLegacyTheme());
	JFreeChart jfreeChart =
		ChartFactory.createGanttChart(
			evaluateTextExpression(getChart().getTitleExpression()),
			evaluateTextExpression(((JRBarPlot)getPlot()).getCategoryAxisLabelExpression()),
			evaluateTextExpression(((JRBarPlot)getPlot()).getValueAxisLabelExpression()),
			(GanttCategoryDataset)getDataset(),
			isShowLegend(),
			true,  //FIXMECHART tooltip: I guess BarPlot is not the best for gantt
			false
			);

	configureChart(jfreeChart);
	
	CategoryPlot categoryPlot = (CategoryPlot)jfreeChart.getPlot();
	//plot.setNoDataMessage("No data to display");
	
	JRBarPlot barPlot = (JRBarPlot)getPlot();
	boolean isShowTickMarks = barPlot.getShowTickMarks() == null ? true : barPlot.getShowTickMarks().booleanValue();
	boolean isShowTickLabels = barPlot.getShowTickLabels() == null ? true : barPlot.getShowTickLabels().booleanValue();
	boolean isShowLabels = barPlot.getShowLabels() == null ? false : barPlot.getShowLabels().booleanValue();
	
	categoryPlot.getDomainAxis().setTickMarksVisible(isShowTickMarks);
	categoryPlot.getDomainAxis().setTickLabelsVisible(isShowTickLabels);
	// Handle the axis formating for the category axis
	configureAxis(
		categoryPlot.getDomainAxis(), barPlot.getCategoryAxisLabelFont(),
		barPlot.getCategoryAxisLabelColor(), barPlot.getCategoryAxisTickLabelFont(),
		barPlot.getCategoryAxisTickLabelColor(), barPlot.getCategoryAxisTickLabelMask(), barPlot.getCategoryAxisVerticalTickLabels(),
		barPlot.getCategoryAxisLineColor(), false, null, null
		);
	((DateAxis)categoryPlot.getRangeAxis()).setTickMarksVisible(isShowTickMarks);
	((DateAxis)categoryPlot.getRangeAxis()).setTickLabelsVisible(isShowTickLabels);
	// Handle the axis formating for the value axis
	configureAxis(
		categoryPlot.getRangeAxis(), barPlot.getValueAxisLabelFont(),
		barPlot.getValueAxisLabelColor(), barPlot.getValueAxisTickLabelFont(),
		barPlot.getValueAxisTickLabelColor(), barPlot.getValueAxisTickLabelMask(), barPlot.getValueAxisVerticalTickLabels(),
		barPlot.getValueAxisLineColor(), true,
		(Comparable<?>)evaluateExpression(barPlot.getRangeAxisMinValueExpression()),
		(Comparable<?>)evaluateExpression(barPlot.getRangeAxisMaxValueExpression()));

	GanttRenderer categoryRenderer = (GanttRenderer)categoryPlot.getRenderer();
	categoryRenderer.setBaseItemLabelGenerator((CategoryItemLabelGenerator)getLabelGenerator());
	categoryRenderer.setBaseItemLabelsVisible(isShowLabels);
	categoryRenderer.setShadowVisible(false);

	return jfreeChart;
}
 
开发者ID:TIBCOSoftware,项目名称:jasperreports,代码行数:57,代码来源:DefaultChartTheme.java


示例17: testPublicCloneable

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



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java ChannelConfig类代码示例发布时间:2022-05-21
下一篇:
Java CountersExceededException类代码示例发布时间:2022-05-21
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap