本文整理汇总了Java中org.jfree.chart.labels.IntervalCategoryToolTipGenerator类的典型用法代码示例。如果您正苦于以下问题:Java IntervalCategoryToolTipGenerator类的具体用法?Java IntervalCategoryToolTipGenerator怎么用?Java IntervalCategoryToolTipGenerator使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
IntervalCategoryToolTipGenerator类属于org.jfree.chart.labels包,在下文中一共展示了IntervalCategoryToolTipGenerator类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createChart
import org.jfree.chart.labels.IntervalCategoryToolTipGenerator; //导入依赖的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;
}
示例2: createGanttChart
import org.jfree.chart.labels.IntervalCategoryToolTipGenerator; //导入依赖的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;
}
示例3: createGanttChart
import org.jfree.chart.labels.IntervalCategoryToolTipGenerator; //导入依赖的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;
}
示例4: createGanttChart
import org.jfree.chart.labels.IntervalCategoryToolTipGenerator; //导入依赖的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;
}
示例5: createGanttChart
import org.jfree.chart.labels.IntervalCategoryToolTipGenerator; //导入依赖的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;
}
示例6: createGanttChart
import org.jfree.chart.labels.IntervalCategoryToolTipGenerator; //导入依赖的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;
}
示例7: createGanttChart
import org.jfree.chart.labels.IntervalCategoryToolTipGenerator; //导入依赖的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;
}
示例8: testEquals2
import org.jfree.chart.labels.IntervalCategoryToolTipGenerator; //导入依赖的package包/类
/**
* Check that the subclass is not equal to an instance of the superclass.
*/
public void testEquals2() {
IntervalCategoryToolTipGenerator g1
= new IntervalCategoryToolTipGenerator();
StandardCategoryToolTipGenerator g2
= new StandardCategoryToolTipGenerator(
IntervalCategoryToolTipGenerator.DEFAULT_TOOL_TIP_FORMAT_STRING,
NumberFormat.getInstance());
assertFalse(g1.equals(g2));
}
示例9: testHashCode
import org.jfree.chart.labels.IntervalCategoryToolTipGenerator; //导入依赖的package包/类
/**
* Simple check that hashCode is implemented.
*/
public void testHashCode() {
IntervalCategoryToolTipGenerator g1
= new IntervalCategoryToolTipGenerator();
IntervalCategoryToolTipGenerator g2
= new IntervalCategoryToolTipGenerator();
assertTrue(g1.equals(g2));
assertTrue(g1.hashCode() == g2.hashCode());
}
示例10: testPublicCloneable
import org.jfree.chart.labels.IntervalCategoryToolTipGenerator; //导入依赖的package包/类
/**
* Check to ensure that this class implements PublicCloneable.
*/
public void testPublicCloneable() {
IntervalCategoryToolTipGenerator g1
= new IntervalCategoryToolTipGenerator();
assertTrue(g1 instanceof PublicCloneable);
}