本文整理汇总了Java中org.jfree.chart.ChartPanel.setPreferredSize方法的典型用法代码示例。如果您正苦于以下问题:Java ChartPanel.setPreferredSize方法的具体用法?Java ChartPanel.setPreferredSize怎么用?Java ChartPanel.setPreferredSize使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.jfree.chart.ChartPanel
的用法示例。
在下文中一共展示了ChartPanel.setPreferredSize方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: MultiLineChart
import org.jfree.chart.ChartPanel; //导入方法依赖的package包/类
public MultiLineChart(final String title, List<Users> tpaverficationUserList) {
super(title);
this.tpaverficationUserList = tpaverficationUserList;
XYDataset dataset = null;
try {
dataset = createDataset();
} catch (Exception e) {
System.out.println("MultiLineChart -- Constructor" + e);
}
final JFreeChart chart = createChart(dataset);
final ChartPanel chartPanel = new ChartPanel(chart);
chartPanel.setPreferredSize(new java.awt.Dimension(700, 470));
setContentPane(chartPanel);
this.pack();
RefineryUtilities.centerFrameOnScreen(this);
this.setVisible(true);
}
开发者ID:cyberheartmi9,项目名称:Mona-Secure-Multi-Owner-Data-Sharing-for-Dynamic-Group-in-the-Cloud,代码行数:19,代码来源:MultiLineChart.java
示例2: KeySignatureGraph
import org.jfree.chart.ChartPanel; //导入方法依赖的package包/类
public KeySignatureGraph(String title, int one, int two) {
super(title);
XYDataset dataset = null;
try {
dataset = createDataset(one, two);
} catch (Exception e) {
System.out.println("MultiLineChart -- Constructor" + e);
}
final JFreeChart chart = createChart(dataset);
final ChartPanel chartPanel = new ChartPanel(chart);
chartPanel.setPreferredSize(new java.awt.Dimension(500, 370));
setContentPane(chartPanel);
this.pack();
RefineryUtilities.centerFrameOnScreen(this);
this.setVisible(true);
setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
}
开发者ID:cyberheartmi9,项目名称:Mona-Secure-Multi-Owner-Data-Sharing-for-Dynamic-Group-in-the-Cloud,代码行数:18,代码来源:KeySignatureGraph.java
示例3: visualizarSerieChartAsignRescateVict
import org.jfree.chart.ChartPanel; //导入方法依赖的package包/类
public void visualizarSerieChartAsignRescateVict(Color color,CategoryDataset dataset) {
ChartPanel chartPanel = new ChartPanel(chartNotifAsigResc);
chartNotifAsigResc.setBackgroundPaint(Color.white);
CategoryPlot plot = (CategoryPlot) chartNotifAsigResc.getPlot();
plot.setBackgroundPaint(color);
plot.setDataset(dataset);
plot.setDomainGridlinePaint(Color.white);
plot.setRangeGridlinePaint(Color.white);
NumberAxis rangeAxis = (NumberAxis) plot.getRangeAxis();
rangeAxis.setUpperMargin(0.15);
CategoryItemRenderer renderer = plot.getRenderer();
renderer.setItemLabelGenerator(new LabelGenerator(50.0));
renderer.setItemLabelFont(new Font("Serif", Font.PLAIN, 8));
renderer.setItemLabelsVisible(true);
chartPanel.setPreferredSize(new java.awt.Dimension(500, 270));
setContentPane(chartPanel);
this.pack();
RefineryUtilities.centerFrameOnScreen(this);
this.setVisible(true);
}
示例4: TimeandCostGraph
import org.jfree.chart.ChartPanel; //导入方法依赖的package包/类
public TimeandCostGraph(String title, int one, int two) {
super(title);
XYDataset dataset = null;
try {
dataset = createDataset();
} catch (Exception e) {
System.out.println("MultiLineChart -- Constructor" + e);
}
final JFreeChart chart = createChart(dataset);
final ChartPanel chartPanel = new ChartPanel(chart);
chartPanel.setPreferredSize(new java.awt.Dimension(700, 470));
setContentPane(chartPanel);
this.pack();
RefineryUtilities.centerFrameOnScreen(this);
this.setVisible(true);
setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
}
开发者ID:cyberheartmi9,项目名称:Mona-Secure-Multi-Owner-Data-Sharing-for-Dynamic-Group-in-the-Cloud,代码行数:19,代码来源:TimeandCostGraph.java
示例5: showJFreeChart
import org.jfree.chart.ChartPanel; //导入方法依赖的package包/类
public void showJFreeChart(int coordX, int coordY){
//Mostrar el chart
ChartPanel chartPanel = new ChartPanel(chart1);
chartPanel.setPreferredSize(new java.awt.Dimension(500, 270));
setContentPane(chartPanel);
this.setDefaultCloseOperation(javax.swing.WindowConstants.DO_NOTHING_ON_CLOSE);
addWindowListener(
new WindowAdapter(){
public void WindowClosing (WindowEvent e){
System.out.println("No quiero cerrar la ventana !!!\n");
}
}
);
this.pack();
// RefineryUtilities.centerFrameOnScreen(this);
this.setLocation(coordX, coordY);
this.setVisible(true);
}
示例6: KeyStorageGraph
import org.jfree.chart.ChartPanel; //导入方法依赖的package包/类
public KeyStorageGraph(String title, int one, int two) {
super(title);
XYDataset dataset = null;
try {
dataset = createDataset();
} catch (Exception e) {
System.out.println("MultiLineChart -- Constructor" + e);
}
final JFreeChart chart = createChart(dataset);
final ChartPanel chartPanel = new ChartPanel(chart);
chartPanel.setPreferredSize(new java.awt.Dimension(500, 370));
setContentPane(chartPanel);
this.pack();
RefineryUtilities.centerFrameOnScreen(this);
this.setVisible(true);
setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
}
开发者ID:cyberheartmi9,项目名称:Mona-Secure-Multi-Owner-Data-Sharing-for-Dynamic-Group-in-the-Cloud,代码行数:20,代码来源:KeyStorageGraph.java
示例7: crearChartCombinadoAsignRescateVict
import org.jfree.chart.ChartPanel; //导入方法依赖的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);
}
示例8: displayChart
import org.jfree.chart.ChartPanel; //导入方法依赖的package包/类
/**
* Displays a chart in a frame.
* @param chart the chart to be displayed
*/
private static void displayChart(JFreeChart chart) {
// Chart panel
ChartPanel panel = new ChartPanel(chart);
panel.setFillZoomRectangle(true);
panel.setMouseWheelEnabled(true);
panel.setPreferredSize(new Dimension(1024, 400));
// Application frame
ApplicationFrame frame = new ApplicationFrame("Ta4j example - Buy and sell signals to chart");
frame.setContentPane(panel);
frame.pack();
RefineryUtilities.centerFrameOnScreen(frame);
frame.setVisible(true);
}
示例9: displayChart
import org.jfree.chart.ChartPanel; //导入方法依赖的package包/类
/**
* Displays a chart in a frame.
* @param chart the chart to be displayed
*/
private static void displayChart(JFreeChart chart) {
// Chart panel
ChartPanel panel = new ChartPanel(chart);
panel.setFillZoomRectangle(true);
panel.setMouseWheelEnabled(true);
panel.setPreferredSize(new java.awt.Dimension(740, 300));
// Application frame
ApplicationFrame frame = new ApplicationFrame("Ta4j example - Candlestick chart");
frame.setContentPane(panel);
frame.pack();
RefineryUtilities.centerFrameOnScreen(frame);
frame.setVisible(true);
}
示例10: crearChartAsignRescateVict
import org.jfree.chart.ChartPanel; //导入方法依赖的package包/类
public JFreeChart crearChartAsignRescateVict(CategoryDataset dataset) {
chartNotifAsigResc = ChartFactory.createLineChart(
"Tiempos de Rescate de Victimas ", // chart title Titulo local del grafico
"Victimas Rescatadas en Entorno", // x axis label
"Tiempo milisegundos", // y axis label
dataset, // data
PlotOrientation.VERTICAL,
true, // include legend
true, // tooltips
false // urls
);
// NOW DO SOME OPTIONAL CUSTOMISATION OF THE CHART...
ChartPanel chartPanel = new ChartPanel(chartNotifAsigResc,false);
chartNotifAsigResc.setBackgroundPaint(Color.white);
// CategoryPlot plot = (CategoryPlot) chartNotifAsigResc.getPlot();
CategoryPlot plot = chartNotifAsigResc.getCategoryPlot();
plot.setBackgroundPaint(Color.lightGray);
plot.setDomainGridlinePaint(Color.white);
plot.setRangeGridlinePaint(Color.white);
NumberAxis rangeAxis = (NumberAxis) plot.getRangeAxis();
rangeAxis.setUpperMargin(0.15);
CategoryItemRenderer renderer = plot.getRenderer();
renderer.setItemLabelGenerator(new LabelGenerator(50.0));
renderer.setItemLabelFont(new Font("Serif", Font.PLAIN, 8));
renderer.setItemLabelsVisible(true);
chartPanel.setPreferredSize(new java.awt.Dimension(500, 270));
setContentPane(chartPanel);
this.pack();
RefineryUtilities.centerFrameOnScreen(this);
this.setVisible(true);
return chartNotifAsigResc;
}
示例11: generatePrecipitazioni
import org.jfree.chart.ChartPanel; //导入方法依赖的package包/类
public void generatePrecipitazioni(){
ChartPanel chart;
synchronized (this.dm){
chart = ChartsGenerator.genertateLineChart("Precipitazioni", "Timestamp", "Quantità", this.dm.getPrecipitazioni());
}
chart.setPreferredSize(new Dimension(this.mf.getjTabbedPane1().getWidth(), this.mf.getjTabbedPane1().getHeight()-20));
this.mf.getjTabbedPane1().addTab("Precipitazioni", chart);
}
示例12: generateIndiceUV
import org.jfree.chart.ChartPanel; //导入方法依赖的package包/类
public void generateIndiceUV(){
ChartPanel chart;
synchronized (this.dm){
chart = ChartsGenerator.genertateLineChart("indiceUV", "Time", "Indice Raggi UV", this.dm.getIndiceUV());
}
chart.setPreferredSize(new Dimension(this.mf.getjTabbedPane1().getWidth(), this.mf.getjTabbedPane1().getHeight()-20));
this.mf.getjTabbedPane1().addTab("indice UV", chart);
}
示例13: generateTemperatura
import org.jfree.chart.ChartPanel; //导入方法依赖的package包/类
public void generateTemperatura(){
ChartPanel chart;
synchronized (this.dm){
chart = ChartsGenerator.genertateLineChart("temperatura", "Time", "Temperatura", this.dm.getTemperatura());
}
chart.setPreferredSize(new Dimension(this.mf.getjTabbedPane1().getWidth(), this.mf.getjTabbedPane1().getHeight()-20));
this.mf.getjTabbedPane1().addTab("Temperatura", chart);
}
示例14: generateVento
import org.jfree.chart.ChartPanel; //导入方法依赖的package包/类
public void generateVento(){
ChartPanel chart;
synchronized (this.dm){
chart = ChartsGenerator.genertateLineChart("Vento", "Time", "Velocità vento", this.dm.getVelocitaVento());
}
chart.setPreferredSize(new Dimension(this.mf.getjTabbedPane1().getWidth(), this.mf.getjTabbedPane1().getHeight()-20));
this.mf.getjTabbedPane1().addTab("Velocità Vento", chart);
}
示例15: generatePressione
import org.jfree.chart.ChartPanel; //导入方法依赖的package包/类
public void generatePressione(){
ChartPanel chart;
synchronized (this.dm){
chart = ChartsGenerator.genertateLineChart("Pressione", "Time", "Pressione", this.dm.getPressione());
}
chart.setPreferredSize(new Dimension(this.mf.getjTabbedPane1().getWidth(), this.mf.getjTabbedPane1().getHeight()-20));
this.mf.getjTabbedPane1().addTab("pressione", chart);
}