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

Java IntervalCategoryDataset类代码示例

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

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



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

示例1: drawItem

import org.jfree.data.category.IntervalCategoryDataset; //导入依赖的package包/类
/**
 * Draws the bar for a single (series, category) data item.
 *
 * @param g2  the graphics device.
 * @param state  the renderer state.
 * @param dataArea  the data area.
 * @param plot  the plot.
 * @param domainAxis  the domain axis.
 * @param rangeAxis  the range axis.
 * @param dataset  the dataset.
 * @param row  the row index (zero-based).
 * @param column  the column index (zero-based).
 */
public void drawItem(Graphics2D g2,
                     CategoryItemRendererState state,
                     Rectangle2D dataArea,
                     CategoryPlot plot,
                     CategoryAxis domainAxis,
                     ValueAxis rangeAxis,
                     CategoryDataset dataset,
                     int row,
                     int column) {

     if (dataset instanceof IntervalCategoryDataset) {
         IntervalCategoryDataset d = (IntervalCategoryDataset) dataset;
         drawInterval(g2, state, dataArea, plot, domainAxis, rangeAxis, d, row, column);
     }
     else {
         super.drawItem(g2, state, dataArea, plot, domainAxis, rangeAxis, dataset, row, column);
     } 
     
 }
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:33,代码来源:IntervalBarRenderer.java


示例2: drawItem

import org.jfree.data.category.IntervalCategoryDataset; //导入依赖的package包/类
/**
 * Draws the bar for a single (series, category) data item.
 *
 * @param g2  the graphics device.
 * @param state  the renderer state.
 * @param dataArea  the data area.
 * @param plot  the plot.
 * @param domainAxis  the domain axis.
 * @param rangeAxis  the range axis.
 * @param dataset  the dataset.
 * @param row  the row index (zero-based).
 * @param column  the column index (zero-based).
 * @param pass  the pass index.
 */
public void drawItem(Graphics2D g2,
                     CategoryItemRendererState state,
                     Rectangle2D dataArea,
                     CategoryPlot plot,
                     CategoryAxis domainAxis,
                     ValueAxis rangeAxis,
                     CategoryDataset dataset,
                     int row,
                     int column,
                     int pass) {

     if (dataset instanceof IntervalCategoryDataset) {
         IntervalCategoryDataset d = (IntervalCategoryDataset) dataset;
         drawInterval(g2, state, dataArea, plot, domainAxis, rangeAxis, 
                 d, row, column);
     }
     else {
         super.drawItem(g2, state, dataArea, plot, domainAxis, rangeAxis, 
                 dataset, row, column, pass);
     } 
     
 }
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:37,代码来源:IntervalBarRenderer.java


示例3: drawItem

import org.jfree.data.category.IntervalCategoryDataset; //导入依赖的package包/类
/**
 * Draws the bar for a single (series, category) data item.
 *
 * @param g2  the graphics device.
 * @param state  the renderer state.
 * @param dataArea  the data area.
 * @param plot  the plot.
 * @param domainAxis  the domain axis.
 * @param rangeAxis  the range axis.
 * @param dataset  the dataset.
 * @param row  the row index (zero-based).
 * @param column  the column index (zero-based).
 * @param pass  the pass index.
 */
@Override
public void drawItem(Graphics2D g2, CategoryItemRendererState state,
        Rectangle2D dataArea, CategoryPlot plot, CategoryAxis domainAxis,
        ValueAxis rangeAxis, CategoryDataset dataset, int row, int column,
        int pass) {

     if (dataset instanceof IntervalCategoryDataset) {
         IntervalCategoryDataset d = (IntervalCategoryDataset) dataset;
         drawInterval(g2, state, dataArea, plot, domainAxis, rangeAxis,
                 d, row, column);
     }
     else {
         super.drawItem(g2, state, dataArea, plot, domainAxis, rangeAxis,
                 dataset, row, column, pass);
     }

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


示例4: drawItem

import org.jfree.data.category.IntervalCategoryDataset; //导入依赖的package包/类
/**
 * Draws the bar for a single (series, category) data item.
 *
 * @param g2  the graphics device.
 * @param state  the renderer state.
 * @param dataArea  the data area.
 * @param plot  the plot.
 * @param domainAxis  the domain axis.
 * @param rangeAxis  the range axis.
 * @param dataset  the dataset.
 * @param row  the row index (zero-based).
 * @param column  the column index (zero-based).
 * @param pass  the pass index.
 */
@Override
public void drawItem(Graphics2D g2, CategoryItemRendererState state,
        Rectangle2D dataArea, CategoryPlot plot, CategoryAxis domainAxis,
        ValueAxis rangeAxis, CategoryDataset dataset, int row, int column,
        int pass) {

     if (dataset instanceof IntervalCategoryDataset) {
         IntervalCategoryDataset d = (IntervalCategoryDataset) dataset;
         drawInterval(g2, state, dataArea, plot, domainAxis, rangeAxis,
                 d, row, column);
     } else {
         super.drawItem(g2, state, dataArea, plot, domainAxis, rangeAxis,
                 dataset, row, column, pass);
     }

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


示例5: createChart

import org.jfree.data.category.IntervalCategoryDataset; //导入依赖的package包/类
private static JFreeChart createChart() {
    final CategoryAxis domainAxis = new CategoryAxis("");
    final NumberAxis rangeAxis = new NumberAxis("");
    final IntervalBarRenderer renderer = new IntervalBarRenderer();
    renderer.setBaseToolTipGenerator(new IntervalCategoryToolTipGenerator());
    renderer.setBaseToolTipGenerator((dataset, row, column) -> {
        final IntervalCategoryDataset icd = (IntervalCategoryDataset) dataset;
        return icd.getRowKey(row) + ": " + (icd.getEndValue(row, column).doubleValue() - icd.getStartValue(row, column).doubleValue());
    });

    final CategoryPlot plot = new CategoryPlot(null, domainAxis, rangeAxis, renderer);
    final JFreeChart chart = new JFreeChart("Unternehmenswert", plot);
    plot.setDomainGridlinesVisible(true);
    plot.setRangePannable(true);
    ChartUtilities.applyCurrentTheme(chart);
    return chart;

}
 
开发者ID:DHBW-Karlsruhe,项目名称:businesshorizon2,代码行数:19,代码来源:DeterResultPanel.java


示例6: drawItem

import org.jfree.data.category.IntervalCategoryDataset; //导入依赖的package包/类
/**
 * Draws the bar for a single (series, category) data item.
 *
 * @param g2  the graphics device.
 * @param state  the renderer state.
 * @param dataArea  the data area.
 * @param plot  the plot.
 * @param domainAxis  the domain axis.
 * @param rangeAxis  the range axis.
 * @param dataset  the dataset.
 * @param row  the row index (zero-based).
 * @param column  the column index (zero-based).
 * @param pass  the pass index.
 */
public void drawItem(Graphics2D g2,
                     CategoryItemRendererState state,
                     Rectangle2D dataArea,
                     CategoryPlot plot,
                     CategoryAxis domainAxis,
                     ValueAxis rangeAxis,
                     CategoryDataset dataset,
                     int row,
                     int column,
                     int pass) {

     if (dataset instanceof IntervalCategoryDataset) {
         IntervalCategoryDataset d = (IntervalCategoryDataset) dataset;
         drawInterval(g2, state, dataArea, plot, domainAxis, rangeAxis,
                 d, row, column);
     }
     else {
         super.drawItem(g2, state, dataArea, plot, domainAxis, rangeAxis,
                 dataset, row, column, pass);
     }

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


示例7: createGanttChart

import org.jfree.data.category.IntervalCategoryDataset; //导入依赖的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


示例8: drawItem

import org.jfree.data.category.IntervalCategoryDataset; //导入依赖的package包/类
/**
 * Draws the bar for a single (series, category) data item.
 *
 * @param g2  the graphics device.
 * @param state  the renderer state.
 * @param dataArea  the data area.
 * @param plot  the plot.
 * @param domainAxis  the domain axis.
 * @param rangeAxis  the range axis.
 * @param dataset  the dataset.
 * @param row  the row index (zero-based).
 * @param column  the column index (zero-based).
 * @param pass  the pass index.
 */
public void drawItem(Graphics2D g2, CategoryItemRendererState state,
        Rectangle2D dataArea, CategoryPlot plot, CategoryAxis domainAxis,
        ValueAxis rangeAxis, CategoryDataset dataset, int row, int column,
        boolean selected, int pass) {

     if (dataset instanceof IntervalCategoryDataset) {
         IntervalCategoryDataset d = (IntervalCategoryDataset) dataset;
         drawInterval(g2, state, dataArea, plot, domainAxis, rangeAxis,
                 d, row, column, selected);
     }
     else {
         super.drawItem(g2, state, dataArea, plot, domainAxis, rangeAxis,
                 dataset, row, column, selected, pass);
     }

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


示例9: generateChart

import org.jfree.data.category.IntervalCategoryDataset; //导入依赖的package包/类
public void generateChart() {
	// gernerate dataset
	IntervalCategoryDataset dataset = createDataset();
	// create chart
	JFreeChart chart = ChartFactory.createGanttChart("Schedule Report", // chart
																		// title
			"Work Item", // domain axis label
			"Date", // range axis label
			dataset, // data
			true, // include legend
			true, // tooltips
			false // urls
			);
	// 設定屬性
	setAttribute(chart);
	// 儲存檔案
	saveChart(chart);
}
 
开发者ID:ezScrum,项目名称:ezScrum,代码行数:19,代码来源:ScheduleReport.java


示例10: createDataset

import org.jfree.data.category.IntervalCategoryDataset; //导入依赖的package包/类
private IntervalCategoryDataset createDataset() {
	SprintBacklogLogic sprintBacklogLogic = new SprintBacklogLogic(
			mProject, mIteration);
	SprintBacklogMapper sb = sprintBacklogLogic.getSprintBacklogMapper();
	TaskSeriesCollection collection = null;
	if (mIteration == -1) {
		mIteration = sb.getSprintId();
	}

	if (sb != null) {
		// 設定抓取iter 時間
		mStartDate = sb.getSprintStartDate();
		mEndDate = sb.getSprintEndDate();
		mSprintGoal = sb.getSprintGoal();
		collection = initTaskCollection(sprintBacklogLogic, sb);

	}
	return collection;
}
 
开发者ID:ezScrum,项目名称:ezScrum,代码行数:20,代码来源:ScheduleReport.java


示例11: createChartGantt

import org.jfree.data.category.IntervalCategoryDataset; //导入依赖的package包/类
/**
 * Creates a chart.
 *
 * @param dataset
 *            the dataset.
 *
 * @return The chart.
 */
private JFreeChart createChartGantt(final IntervalCategoryDataset dataset) {
	return ChartFactory.createGanttChart("Gantt Chart Demo", // chart
																// title
			"Task", // domain axis label
			"Date", // range axis label
			dataset, // data
			true, // include legend
			true, // tooltips
			false // urls
	);
}
 
开发者ID:rototor,项目名称:pdfbox-graphics2d,代码行数:20,代码来源:MultiPageTest.java


示例12: createGanttChart

import org.jfree.data.category.IntervalCategoryDataset; //导入依赖的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


示例13: createItemArray

import org.jfree.data.category.IntervalCategoryDataset; //导入依赖的package包/类
/**
 * Creates the array of items that can be passed to the <code>MessageFormat</code> class
 * for creating labels.
 *
 * @param dataset  the dataset (<code>null</code> not permitted).
 * @param row  the row index (zero-based).
 * @param column  the column index (zero-based).
 *
 * @return The items (never <code>null</code>).
 */
protected Object[] createItemArray(CategoryDataset dataset, int row, int column) {
    Object[] result = new Object[5];
    result[0] = dataset.getRowKey(row).toString();
    result[1] = dataset.getColumnKey(column).toString();
    Number value = dataset.getValue(row, column);
    if (getNumberFormat() != null) {
        result[2] = getNumberFormat().format(value);  
    }
    else if (getDateFormat() != null) {
        result[2] = getDateFormat().format(value);
    }
    
    if (dataset instanceof IntervalCategoryDataset) {
        IntervalCategoryDataset icd = (IntervalCategoryDataset) dataset;
        Number start = icd.getStartValue(row, column);
        Number end = icd.getEndValue(row, column);
        if (getNumberFormat() != null) {
            result[3] = getNumberFormat().format(start);  
            result[4] = getNumberFormat().format(end);  
        }
        else if (getDateFormat() != null) {
            result[3] = getDateFormat().format(start);
            result[4] = getDateFormat().format(end);
        }
    }
    return result;
}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:38,代码来源:IntervalCategoryToolTipGenerator.java


示例14: iterateCategoryRangeExtent

import org.jfree.data.category.IntervalCategoryDataset; //导入依赖的package包/类
/**
 * Iterates over the data item of the category dataset to find
 * the range extent.
 * 
 * @param dataset  the dataset (<code>null</code> not permitted).
 * 
 * @return The range (possibly <code>null</code>).
 */
public static Range iterateCategoryRangeExtent(CategoryDataset dataset) {
    double minimum = Double.POSITIVE_INFINITY;
    double maximum = Double.NEGATIVE_INFINITY;
    int rowCount = dataset.getRowCount();
    int columnCount = dataset.getColumnCount();
    for (int row = 0; row < rowCount; row++) {
        for (int column = 0; column < columnCount; column++) {
            Number lvalue;
            Number uvalue;
            if (dataset instanceof IntervalCategoryDataset) {
                IntervalCategoryDataset icd = (IntervalCategoryDataset) dataset;
                lvalue = icd.getStartValue(row, column);
                uvalue = icd.getEndValue(row, column);
            }
            else {
                lvalue = dataset.getValue(row, column);
                uvalue = lvalue;
            }
            if (lvalue != null) {
                minimum = Math.min(minimum, lvalue.doubleValue());
            }
            if (uvalue != null) {
                maximum = Math.max(maximum, uvalue.doubleValue());
            }
        }
    }
    if (minimum == Double.POSITIVE_INFINITY) {
        return null;
    }
    else {
        return new Range(minimum, maximum);
    }
}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:42,代码来源:DatasetUtilities.java


示例15: createGanttChart

import org.jfree.data.category.IntervalCategoryDataset; //导入依赖的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


示例16: createItemArray

import org.jfree.data.category.IntervalCategoryDataset; //导入依赖的package包/类
/**
 * Creates the array of items that can be passed to the 
 * <code>MessageFormat</code> class for creating labels.
 *
 * @param dataset  the dataset (<code>null</code> not permitted).
 * @param row  the row index (zero-based).
 * @param column  the column index (zero-based).
 *
 * @return The items (never <code>null</code>).
 */
protected Object[] createItemArray(CategoryDataset dataset, 
                                   int row, int column) {
    Object[] result = new Object[5];
    result[0] = dataset.getRowKey(row).toString();
    result[1] = dataset.getColumnKey(column).toString();
    Number value = dataset.getValue(row, column);
    if (getNumberFormat() != null) {
        result[2] = getNumberFormat().format(value);  
    }
    else if (getDateFormat() != null) {
        result[2] = getDateFormat().format(value);
    }
    
    if (dataset instanceof IntervalCategoryDataset) {
        IntervalCategoryDataset icd = (IntervalCategoryDataset) dataset;
        Number start = icd.getStartValue(row, column);
        Number end = icd.getEndValue(row, column);
        if (getNumberFormat() != null) {
            result[3] = getNumberFormat().format(start);  
            result[4] = getNumberFormat().format(end);  
        }
        else if (getDateFormat() != null) {
            result[3] = getDateFormat().format(start);
            result[4] = getDateFormat().format(end);
        }
    }
    return result;
}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:39,代码来源:IntervalCategoryToolTipGenerator.java


示例17: iterateCategoryRangeBounds

import org.jfree.data.category.IntervalCategoryDataset; //导入依赖的package包/类
/**
 * Iterates over the data item of the category dataset to find
 * the range bounds.
 * 
 * @param dataset  the dataset (<code>null</code> not permitted).
 * @param includeInterval  a flag that determines whether or not the
 *                         y-interval is taken into account.
 * 
 * @return The range (possibly <code>null</code>).
 */
public static Range iterateCategoryRangeBounds(CategoryDataset dataset, 
        boolean includeInterval) {
    double minimum = Double.POSITIVE_INFINITY;
    double maximum = Double.NEGATIVE_INFINITY;
    boolean interval = includeInterval 
                       && dataset instanceof IntervalCategoryDataset;
    int rowCount = dataset.getRowCount();
    int columnCount = dataset.getColumnCount();
    for (int row = 0; row < rowCount; row++) {
        for (int column = 0; column < columnCount; column++) {
            Number lvalue;
            Number uvalue;
            if (interval) {
                IntervalCategoryDataset icd 
                    = (IntervalCategoryDataset) dataset;
                lvalue = icd.getStartValue(row, column);
                uvalue = icd.getEndValue(row, column);
            }
            else {
                lvalue = dataset.getValue(row, column);
                uvalue = lvalue;
            }
            if (lvalue != null) {
                minimum = Math.min(minimum, lvalue.doubleValue());
            }
            if (uvalue != null) {
                maximum = Math.max(maximum, uvalue.doubleValue());
            }
        }
    }
    if (minimum == Double.POSITIVE_INFINITY) {
        return null;
    }
    else {
        return new Range(minimum, maximum);
    }
}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:48,代码来源:DatasetUtilities.java


示例18: createGanttChart

import org.jfree.data.category.IntervalCategoryDataset; //导入依赖的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


示例19: createItemArray

import org.jfree.data.category.IntervalCategoryDataset; //导入依赖的package包/类
/**
 * Creates the array of items that can be passed to the
 * <code>MessageFormat</code> class for creating labels.
 *
 * @param dataset  the dataset (<code>null</code> not permitted).
 * @param row  the row index (zero-based).
 * @param column  the column index (zero-based).
 *
 * @return The items (never <code>null</code>).
 */
@Override
protected Object[] createItemArray(CategoryDataset dataset,
                                   int row, int column) {
    Object[] result = new Object[5];
    result[0] = dataset.getRowKey(row).toString();
    result[1] = dataset.getColumnKey(column).toString();
    Number value = dataset.getValue(row, column);
    if (getNumberFormat() != null) {
        result[2] = getNumberFormat().format(value);
    }
    else if (getDateFormat() != null) {
        result[2] = getDateFormat().format(value);
    }

    if (dataset instanceof IntervalCategoryDataset) {
        IntervalCategoryDataset icd = (IntervalCategoryDataset) dataset;
        Number start = icd.getStartValue(row, column);
        Number end = icd.getEndValue(row, column);
        if (getNumberFormat() != null) {
            result[3] = getNumberFormat().format(start);
            result[4] = getNumberFormat().format(end);
        }
        else if (getDateFormat() != null) {
            result[3] = getDateFormat().format(start);
            result[4] = getDateFormat().format(end);
        }
    }
    return result;
}
 
开发者ID:mdzio,项目名称:ccu-historian,代码行数:40,代码来源:IntervalCategoryToolTipGenerator.java


示例20: findMinimumRangeValue

import org.jfree.data.category.IntervalCategoryDataset; //导入依赖的package包/类
/**
 * Returns the minimum range value for the specified dataset.  This is
 * easy if the dataset implements the {@link RangeInfo} interface (a good
 * idea if there is an efficient way to determine the minimum value).
 * Otherwise, it involves iterating over the entire data-set.  Returns
 * <code>null</code> if all the data values in the dataset are
 * <code>null</code>.
 *
 * @param dataset  the dataset (<code>null</code> not permitted).
 *
 * @return The minimum value (possibly <code>null</code>).
 */
public static Number findMinimumRangeValue(CategoryDataset dataset) {
    ParamChecks.nullNotPermitted(dataset, "dataset");
    if (dataset instanceof RangeInfo) {
        RangeInfo info = (RangeInfo) dataset;
        return new Double(info.getRangeLowerBound(true));
    }

    // hasn't implemented RangeInfo, so we'll have to iterate...
    else {
        double minimum = Double.POSITIVE_INFINITY;
        int seriesCount = dataset.getRowCount();
        int itemCount = dataset.getColumnCount();
        for (int series = 0; series < seriesCount; series++) {
            for (int item = 0; item < itemCount; item++) {
                Number value;
                if (dataset instanceof IntervalCategoryDataset) {
                    IntervalCategoryDataset icd
                            = (IntervalCategoryDataset) dataset;
                    value = icd.getStartValue(series, item);
                }
                else {
                    value = dataset.getValue(series, item);
                }
                if (value != null) {
                    minimum = Math.min(minimum, value.doubleValue());
                }
            }
        }
        if (minimum == Double.POSITIVE_INFINITY) {
            return null;
        }
        else {
            return new Double(minimum);
        }

    }

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



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
Java CanExecute类代码示例发布时间:2022-05-21
下一篇:
Java Logger类代码示例发布时间: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