本文整理汇总了Java中org.jfree.chart.plot.CombinedDomainCategoryPlot类的典型用法代码示例。如果您正苦于以下问题:Java CombinedDomainCategoryPlot类的具体用法?Java CombinedDomainCategoryPlot怎么用?Java CombinedDomainCategoryPlot使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
CombinedDomainCategoryPlot类属于org.jfree.chart.plot包,在下文中一共展示了CombinedDomainCategoryPlot类的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createPlot
import org.jfree.chart.plot.CombinedDomainCategoryPlot; //导入依赖的package包/类
/**
* Creates a sample plot.
*
* @return A sample plot.
*/
private CombinedDomainCategoryPlot createPlot() {
CategoryDataset dataset1 = createDataset1();
NumberAxis rangeAxis1 = new NumberAxis("Value");
rangeAxis1.setStandardTickUnits(NumberAxis.createIntegerTickUnits());
LineAndShapeRenderer renderer1 = new LineAndShapeRenderer();
renderer1.setBaseToolTipGenerator(new StandardCategoryToolTipGenerator());
CategoryPlot subplot1 = new CategoryPlot(dataset1, null, rangeAxis1, renderer1);
subplot1.setDomainGridlinesVisible(true);
CategoryDataset dataset2 = createDataset2();
NumberAxis rangeAxis2 = new NumberAxis("Value");
rangeAxis2.setStandardTickUnits(NumberAxis.createIntegerTickUnits());
BarRenderer renderer2 = new BarRenderer();
renderer2.setBaseToolTipGenerator(new StandardCategoryToolTipGenerator());
CategoryPlot subplot2 = new CategoryPlot(dataset2, null, rangeAxis2, renderer2);
subplot2.setDomainGridlinesVisible(true);
CategoryAxis domainAxis = new CategoryAxis("Category");
CombinedDomainCategoryPlot plot = new CombinedDomainCategoryPlot(domainAxis);
plot.add(subplot1, 2);
plot.add(subplot2, 1);
return plot;
}
示例2: testNotification
import org.jfree.chart.plot.CombinedDomainCategoryPlot; //导入依赖的package包/类
/**
* Check that only one chart change event is generated by a change to a
* subplot.
*/
public void testNotification() {
CombinedDomainCategoryPlot plot = createPlot();
JFreeChart chart = new JFreeChart(plot);
chart.addChangeListener(this);
CategoryPlot subplot1 = (CategoryPlot) plot.getSubplots().get(0);
NumberAxis yAxis = (NumberAxis) subplot1.getRangeAxis();
yAxis.setAutoRangeIncludesZero(!yAxis.getAutoRangeIncludesZero());
assertEquals(1, this.events.size());
// a redraw should NOT trigger another change event
BufferedImage image = new BufferedImage(200, 100,
BufferedImage.TYPE_INT_RGB);
Graphics2D g2 = image.createGraphics();
this.events.clear();
chart.draw(g2, new Rectangle2D.Double(0.0, 0.0, 200.0, 100.0));
assertTrue(this.events.isEmpty());
}
示例3: crearChartCombinadoAsignRescateVict
import org.jfree.chart.plot.CombinedDomainCategoryPlot; //导入依赖的package包/类
void crearChartCombinadoAsignRescateVict(CategoryDataset dataset1,CategoryDataset dataset2) {
// CategoryDataset dataset1 = createDataset1();
NumberAxis rangeAxis1 = new NumberAxis("Tiempos en milisegundos");
rangeAxis1.setStandardTickUnits(NumberAxis.createIntegerTickUnits());
LineAndShapeRenderer renderer1 = new LineAndShapeRenderer();
renderer1.setBaseToolTipGenerator(new StandardCategoryToolTipGenerator());
CategoryPlot subplot1 = new CategoryPlot(dataset1, null, rangeAxis1, renderer1);
subplot1.setDomainGridlinesVisible(true);
// CategoryDataset dataset2 = createDataset2();
NumberAxis rangeAxis2 = new NumberAxis("Unidades de energ�a");
rangeAxis2.setStandardTickUnits(NumberAxis.createIntegerTickUnits());
BarRenderer renderer2 = new BarRenderer();
renderer2.setBaseToolTipGenerator(new StandardCategoryToolTipGenerator());
CategoryPlot subplot2 = new CategoryPlot(dataset2, null, rangeAxis2, renderer2);
subplot2.setDomainGridlinesVisible(true);
CategoryAxis domainAxis = new CategoryAxis("Victimas ordenadas por tiempos de rescate");
CombinedDomainCategoryPlot plot = new CombinedDomainCategoryPlot(domainAxis);
plot.add(subplot1, 2);
plot.add(subplot2, 1);
JFreeChart result = new JFreeChart(
"Tiempos de Rescate y Energ�a consumida para salvar las victimas",
new Font("SansSerif", Font.BOLD, 12),
plot,
true
);
ChartPanel chartPanel = new ChartPanel(result);
chartPanel.setPreferredSize(new java.awt.Dimension(500, 270));
this.visualizar(chartPanel);
// setContentPane(chartPanel);
// this.pack();
// RefineryUtilities.centerFrameOnScreen(this);
// this.setVisible(true);
}
示例4: testRemoveSubplot
import org.jfree.chart.plot.CombinedDomainCategoryPlot; //导入依赖的package包/类
/**
* This is a test to replicate the bug report 987080.
*/
public void testRemoveSubplot() {
CombinedDomainCategoryPlot plot = new CombinedDomainCategoryPlot();
CategoryPlot plot1 = new CategoryPlot();
CategoryPlot plot2 = new CategoryPlot();
plot.add(plot1);
plot.add(plot2);
// remove plot2, but plot1 is removed instead
plot.remove(plot2);
List plots = plot.getSubplots();
assertTrue(plots.get(0) == plot1);
}
示例5: testEquals
import org.jfree.chart.plot.CombinedDomainCategoryPlot; //导入依赖的package包/类
/**
* Test the equals() method.
*/
public void testEquals() {
CombinedDomainCategoryPlot plot1 = createPlot();
CombinedDomainCategoryPlot plot2 = createPlot();
assertTrue(plot1.equals(plot2));
}
示例6: testRemoveSubplot
import org.jfree.chart.plot.CombinedDomainCategoryPlot; //导入依赖的package包/类
/**
* This is a test to replicate the bug report 987080.
*/
public void testRemoveSubplot() {
CombinedDomainCategoryPlot plot = new CombinedDomainCategoryPlot();
CategoryPlot plot1 = new CategoryPlot();
CategoryPlot plot2 = new CategoryPlot();
plot.add(plot1);
plot.add(plot2);
// remove plot2, but plot1 is removed instead
plot.remove(plot2);
List plots = plot.getSubplots();
assertTrue(plots.get(0) == plot1);
assertEquals(1, plots.size());
}
示例7: createPlot
import org.jfree.chart.plot.CombinedDomainCategoryPlot; //导入依赖的package包/类
/**
* Creates a sample plot.
*
* @return A sample plot.
*/
private CombinedDomainCategoryPlot createPlot() {
CategoryDataset dataset1 = createDataset1();
NumberAxis rangeAxis1 = new NumberAxis("Value");
rangeAxis1.setStandardTickUnits(NumberAxis.createIntegerTickUnits());
LineAndShapeRenderer renderer1 = new LineAndShapeRenderer();
renderer1.setBaseToolTipGenerator(
new StandardCategoryToolTipGenerator()
);
CategoryPlot subplot1 = new CategoryPlot(
dataset1, null, rangeAxis1, renderer1
);
subplot1.setDomainGridlinesVisible(true);
CategoryDataset dataset2 = createDataset2();
NumberAxis rangeAxis2 = new NumberAxis("Value");
rangeAxis2.setStandardTickUnits(NumberAxis.createIntegerTickUnits());
BarRenderer renderer2 = new BarRenderer();
renderer2.setBaseToolTipGenerator(
new StandardCategoryToolTipGenerator()
);
CategoryPlot subplot2 = new CategoryPlot(
dataset2, null, rangeAxis2, renderer2
);
subplot2.setDomainGridlinesVisible(true);
CategoryAxis domainAxis = new CategoryAxis("Category");
CombinedDomainCategoryPlot plot
= new CombinedDomainCategoryPlot(domainAxis);
plot.add(subplot1, 2);
plot.add(subplot2, 1);
return plot;
}
示例8: createPlot
import org.jfree.chart.plot.CombinedDomainCategoryPlot; //导入依赖的package包/类
/**
* Creates a sample plot.
*
* @return A sample plot.
*/
private CombinedDomainCategoryPlot createPlot() {
CategoryDataset dataset1 = createDataset1();
NumberAxis rangeAxis1 = new NumberAxis("Value");
rangeAxis1.setStandardTickUnits(NumberAxis.createIntegerTickUnits());
LineAndShapeRenderer renderer1 = new LineAndShapeRenderer();
renderer1.setBaseToolTipGenerator(
new StandardCategoryToolTipGenerator()
);
CategoryPlot subplot1 = new CategoryPlot(
dataset1, null, rangeAxis1, renderer1
);
subplot1.setDomainGridlinesVisible(true);
CategoryDataset dataset2 = createDataset2();
NumberAxis rangeAxis2 = new NumberAxis("Value");
rangeAxis2.setStandardTickUnits(NumberAxis.createIntegerTickUnits());
BarRenderer renderer2 = new BarRenderer();
renderer2.setBaseToolTipGenerator(
new StandardCategoryToolTipGenerator()
);
CategoryPlot subplot2 = new CategoryPlot(
dataset2, null, rangeAxis2, renderer2
);
subplot2.setDomainGridlinesVisible(true);
CategoryAxis domainAxis = new CategoryAxis("Category");
CombinedDomainCategoryPlot plot
= new CombinedDomainCategoryPlot(domainAxis);
plot.add(subplot1, 2);
plot.add(subplot2, 1);
return plot;
}
示例9: testEquals
import org.jfree.chart.plot.CombinedDomainCategoryPlot; //导入依赖的package包/类
/**
* Some checks for the equals() method.
*/
public void testEquals() {
CombinedDomainCategoryPlot plot1 = createPlot();
CombinedDomainCategoryPlot plot2 = createPlot();
assertTrue(plot1.equals(plot2));
}
示例10: chartMouseClicked
import org.jfree.chart.plot.CombinedDomainCategoryPlot; //导入依赖的package包/类
@Override
public void chartMouseClicked(ChartMouseEvent event) {
try {
int mouseX = event.getTrigger().getX();
int mouseY = event.getTrigger().getY();
Point mousePoint = new Point(mouseX, mouseY);
CombinedDomainCategoryPlot combinedDomainCategoryPlot = (CombinedDomainCategoryPlot) event.getChart()
.getPlot();
ChartRenderingInfo chartInfo = boxAndWiskerPanel.getChartRenderingInfo();
Point2D java2DPoint = boxAndWiskerPanel.translateScreenToJava2D(mousePoint);
PlotRenderingInfo plotInfo = chartInfo.getPlotInfo();
int subplotIndex = plotInfo.getSubplotIndex(java2DPoint);
if (subplotIndex >= 0) {
Rectangle2D dataArea = plotInfo.getDataArea();
CategoryPlot categoryPlot = (CategoryPlot) combinedDomainCategoryPlot.getSubplots().get(subplotIndex);
ValueAxis rangeAxis = categoryPlot.getRangeAxis();
long logEntryTimestamp = (long) rangeAxis.java2DToValue(java2DPoint.getY(), dataArea,
categoryPlot.getRangeAxisEdge());
LOG.info("subplotIndex: " + subplotIndex + " logEntryTimestamp: " + logEntryTimestamp);
// int rowNumber = ltm
// .getClosestLogEntryRowIndex(logEntryTimestamp);
//
// if (rowNumber >= 0) {
// logTable.setRowSelectionInterval(rowNumber, rowNumber);
// logTable.scrollRowToVisible(rowNumber);
// }
}
} catch (Exception e) {
LOG.error("Error handling mouse click", e);
}
}
示例11: testEquals
import org.jfree.chart.plot.CombinedDomainCategoryPlot; //导入依赖的package包/类
/**
* Some checks for the equals() method.
*/
public void testEquals() {
CombinedDomainCategoryPlot plot1 = createPlot();
CombinedDomainCategoryPlot plot2 = createPlot();
assertTrue(plot1.equals(plot2));
}
示例12: getBoxAndWiskerPanel
import org.jfree.chart.plot.CombinedDomainCategoryPlot; //导入依赖的package包/类
/**
* @return the boxAndWiskerPanel
*/
private ChartPanel getBoxAndWiskerPanel() {
if (boxAndWiskerPanel == null) {
CombinedDomainCategoryPlot combinedBoxAndWiskerCategoryPlot = getCombinedBoxAndWiskerCategoryPlot();
JFreeChart jFreeChart = new JFreeChart(" ", JFreeChart.DEFAULT_TITLE_FONT,
combinedBoxAndWiskerCategoryPlot, false);
ChartUtilities.applyCurrentTheme(jFreeChart);
TextTitle t = jFreeChart.getTitle();
t.setHorizontalAlignment(HorizontalAlignment.CENTER);
t.setPaint(Color.DARK_GRAY);
t.setFont(new Font("Arial", Font.BOLD, 12));
t.setPadding(10, 10, 5, 10);
boxAndWiskerPanel = new ChartPanel(jFreeChart);
Dimension preferredSize = new Dimension(140, 200);
boxAndWiskerPanel.setMinimumSize(preferredSize);
boxAndWiskerPanel.setPreferredSize(preferredSize);
boxAndWiskerPanel.setMinimumDrawWidth(0);
boxAndWiskerPanel.setMinimumDrawHeight(0);
boxAndWiskerPanel.setMaximumDrawWidth(Integer.MAX_VALUE);
boxAndWiskerPanel.setMaximumDrawHeight(Integer.MAX_VALUE);
boxAndWiskerPanel.setMouseWheelEnabled(true);
boxAndWiskerPanel.addChartMouseListener(new CombinedDomainCategoryPlotMouseListener(chartPanel, logTable));
boxAndWiskerPanel.setBorder(BorderFactory.createLineBorder(Color.LIGHT_GRAY, 1));
// TODO revert when functionality done
boxAndWiskerPanel.setVisible(true);
}
return boxAndWiskerPanel;
}