本文整理汇总了Java中org.jfree.chart.ChartFrame.setSize方法的典型用法代码示例。如果您正苦于以下问题:Java ChartFrame.setSize方法的具体用法?Java ChartFrame.setSize怎么用?Java ChartFrame.setSize使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.jfree.chart.ChartFrame
的用法示例。
在下文中一共展示了ChartFrame.setSize方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: graficarEstado
import org.jfree.chart.ChartFrame; //导入方法依赖的package包/类
public void graficarEstado() {
String TAct = txtTotalActivo.getText();
// String TAsp = txtTotalAspirante.getText();
String TMor = txtTotalMoroso.getText();
DefaultPieDataset pieDataset = new DefaultPieDataset();
// pieDataset.setValue("Aspirante", new Integer(TAsp));
pieDataset.setValue("Activo", new Integer(TAct));
pieDataset.setValue("Moroso", new Integer(TMor));
JFreeChart chart = ChartFactory.createPieChart3D("Estado de los Socios", pieDataset, true, true, true);
PiePlot3D p = (PiePlot3D) chart.getPlot();
ChartFrame frame = new ChartFrame("Grafico de Torta", chart);
frame.setVisible(true);
frame.setSize(700, 500);
}
示例2: JFreeChartIcon
import org.jfree.chart.ChartFrame; //导入方法依赖的package包/类
public JFreeChartIcon() {
XYSeries series = new XYSeries( "" );
for ( int i = 0; i < 100; i++ ) {
series.add( i, Math.sin( i / 10.0 ) );
}
dataset = new XYSeriesCollection( series );
JFreeChart jFreeChart = ChartFactory.createXYLineChart( WIStrings.getString( "chart.chart" ), "", "", dataset, PlotOrientation.VERTICAL, false, false, false );
// jFreeChart.getXYPlot().getRangeAxis().setTickLabelsVisible( false );
// jFreeChart.getXYPlot().getDomainAxis().setTickLabelsVisible( false );
BasicStroke stroke = new BasicStroke( 4, BasicStroke.CAP_BUTT, BasicStroke.JOIN_MITER, 1, new float[] { 5, 1 }, 0 );
// BasicStroke stroke = new BasicStroke( 5 );
jFreeChart.getXYPlot().setRangeGridlineStroke( stroke );
jFreeChart.getXYPlot().setRangeGridlinePaint( Color.black );
jFreeChart.getXYPlot().setDomainGridlineStroke( stroke );
jFreeChart.getXYPlot().setDomainGridlinePaint( Color.black );
jFreeChart.setAntiAlias( true );
XYLineAndShapeRenderer renderer = new XYLineAndShapeRenderer( true, false );
renderer.setPaint( Color.blue );
renderer.setStroke( new BasicStroke( 10 ) );
// renderer.set
jFreeChart.getXYPlot().setRenderer( renderer );
ChartFrame chartFrame = new ChartFrame( "", jFreeChart );
chartFrame.setSize( 200, 200 );
chartFrame.setVisible( true );
chartFrame.setDefaultCloseOperation( JFrame.EXIT_ON_CLOSE );
}
示例3: WBSChart
import org.jfree.chart.ChartFrame; //导入方法依赖的package包/类
/**
* Konstruktor
*
*
* @param dataSet vorbereitete Daten
* @param parent zur mittigen Positinierung auf dem Bildschirm
*/
public WBSChart(TimeSeriesCollection dataSet, JFrame parent) {
if (dataSet == null || dataSet.getSeries().isEmpty()) {
Controller.showMessage("Es sind zuwenig Daten vorhanden oder die Laufzeit des AP ist nicht lang genug");
} else {
charty = createChart(dataSet);
frame = new ChartFrame(LocalizedStrings.getChart().diagramView(), charty);
frame.setSize(new Dimension(1024, 700));
frame.setResizable(true);
frame.getChartPanel().setPopupMenu(null);
frame.getChartPanel().setRangeZoomable(false);
Controller.centerComponent(parent, frame);
frame.setVisible(true);
}
}
示例4: drawDiagram
import org.jfree.chart.ChartFrame; //导入方法依赖的package包/类
protected JFreeChart drawDiagram(String s, List<Double> values) {
XYSeries graph = new XYSeries(s);
XYDataset xyDataset = new XYSeriesCollection(graph);
int i = 0;
for (double d:values) {
i++;
graph.add(i, d);
}
JFreeChart chart = ChartFactory.createXYLineChart(
"Quality of Solutions", "Number of Iteration", "deviation from optimal solution in %",
xyDataset, PlotOrientation.VERTICAL, true, true, false);
ChartFrame graphFrame = new ChartFrame("Quality of Solutions vs. Number of Iterations", chart);
graphFrame.setVisible(true);
graphFrame.setSize(300, 300);
return chart;
}
示例5: main
import org.jfree.chart.ChartFrame; //导入方法依赖的package包/类
public static void main(String arg[]){
XYSeries series = new XYSeries("Average Weight");
series.add(20, 20);
series.add(40, 25);
series.add(55, 50);
series.add(70, 65);
// series.add(20.0, 20.0);
// series.add(40.0, 25.0);
// series.add(55.0, 50.0);
// series.add(70.0, 65.0);
XYDataset xyDataset = new XYSeriesCollection(series);
JFreeChart chart = ChartFactory.createXYLineChart
("XYLine Chart using JFreeChart", "Age", "Weight", xyDataset, PlotOrientation.VERTICAL, true, true, false);
ChartFrame frame1=new ChartFrame("XYLine Chart",chart);
frame1.setVisible(true);
frame1.setSize(300,300);
}
示例6: ScatterPlotChart
import org.jfree.chart.ChartFrame; //导入方法依赖的package包/类
public ScatterPlotChart() {
List<RatingDisBean> list = ScatterDataAnalysis.getInstance().selectBookInfo();
XYDataset xydataset = createxydataset("Rating Distribution", list);
JFreeChart chart = createChart(xydataset, "Rating People", "Rating");
chart.getTitle().setFont(new Font("微软雅黑", Font.PLAIN, 25));
ChartFrame frame = new ChartFrame("distribution", chart);
frame.setSize(new Dimension(700,500));
frame.pack();
RefineryUtilities.centerFrameOnScreen(frame);
frame.setVisible(true);
}
示例7: DessinerBar
import org.jfree.chart.ChartFrame; //导入方法依赖的package包/类
public void DessinerBar() {
DefaultCategoryDataset dataset=new DefaultCategoryDataset();
dataset.addValue(100, "score", "CULTURE GENERALE");
dataset.addValue(45, "score", "TECHNIQUE JAVA");
dataset.addValue(75, "score", "LANGAGE EXOTIQUE");
dataset.addValue(18, "score", "QUESTION STRESS");
JFreeChart chart=ChartFactory.createBarChart3D(null, null, null, dataset,PlotOrientation.VERTICAL, false, true, false);
CategoryPlot p= chart.getCategoryPlot();
p.setRangeGridlinePaint(Color.BLACK);
ChartFrame frame=new ChartFrame("statistique test", chart);
frame.setSize(800,500);
frame.setVisible(true);
}
示例8: DessinerCam
import org.jfree.chart.ChartFrame; //导入方法依赖的package包/类
public void DessinerCam() {
DefaultPieDataset data=new DefaultPieDataset();
data.setValue("Culture G�n�rale 100%",100);
data.setValue("Technique Java 27% ",27.9);
data.setValue("Langage exotique 45%",45);
data.setValue("Question stress 100%",100);
JFreeChart chart=ChartFactory.createPieChart3D(null, data);
ChartFrame frame=new ChartFrame("statistique test", chart);
frame.setSize(600,450);
frame.setVisible(true);
}
示例9: execute
import org.jfree.chart.ChartFrame; //导入方法依赖的package包/类
public Boolean execute()
{
DefaultCategoryDataset dataset = new DefaultCategoryDataset();
dataset.setValue(6.0D, "Science", "Rahul");
dataset.setValue(8.0D, "Maths", "Rahul");
dataset.setValue(5.0D, "Science", "Deepak");
dataset.setValue(3.0D, "Maths", "Deepak");
dataset.setValue(6.0D, "Science", "Vinod");
dataset.setValue(9.0D, "Maths", "Vinod");
dataset.setValue(2.0D, "Science", "Chandan");
dataset.setValue(4.0D, "Maths", "Chandan");
JFreeChart chart = ChartFactory.createBarChart3D("Comparison between Students", "Students", "Marks", dataset, PlotOrientation.VERTICAL, true, true, false);
chart.setBackgroundPaint(Color.white);
chart.getTitle().setPaint(Color.blue);
CategoryPlot p = chart.getCategoryPlot();
p.setRangeGridlinePaint(Color.red);
ChartFrame frame1 = new ChartFrame("3D Bar Chart", chart);
frame1.setVisible(true);
frame1.setSize(300, 300);
DefaultCategoryDataset dataset1 = new DefaultCategoryDataset();
dataset1.setValue(6.0D, "Rahul", "Science");
dataset1.setValue(8.0D, "Rahul", "Maths");
dataset1.setValue(5.0D, "Deepak", "Science");
dataset1.setValue(3.0D, "Deepak", "Maths");
dataset1.setValue(6.0D, "Vinod", "Science");
dataset1.setValue(9.0D, "Vinod", "Maths");
dataset1.setValue(2.0D, "Chandan", "Science");
dataset1.setValue(4.0D, "Chandan", "Maths");
JFreeChart chart1 = ChartFactory.createBarChart3D("Comparison between Students - pivoted", "Discipline", "Marks", dataset1, PlotOrientation.VERTICAL, true, true, false);
chart1.setBackgroundPaint(Color.white);
chart1.getTitle().setPaint(Color.blue);
CategoryPlot p1 = chart1.getCategoryPlot();
p1.setRangeGridlinePaint(Color.red);
ChartFrame frame2 = new ChartFrame("3D Bar Chart", chart1);
frame2.setVisible(true);
frame2.setSize(300, 300);
return new Boolean(true);
}
示例10: plotOptimalPolicyCost
import org.jfree.chart.ChartFrame; //导入方法依赖的package包/类
static void plotOptimalPolicyCost(int targetPeriod, BackwardRecursionImpl recursion){
recursion.runBackwardRecursion(targetPeriod);
XYSeries series = new XYSeries("Optimal policy");
for(double i = StateImpl.getMinState(); i <= StateImpl.getMaxState(); i += StateImpl.getStepSize()){
StateDescriptorImpl stateDescriptor = new StateDescriptorImpl(targetPeriod, i);
series.add(i,recursion.getExpectedCost(stateDescriptor));
}
XYDataset xyDataset = new XYSeriesCollection(series);
JFreeChart chart = ChartFactory.createXYLineChart("Optimal policy policy - period "+targetPeriod+" expected total cost", "Opening inventory level", "Expected total cost",
xyDataset, PlotOrientation.VERTICAL, false, true, false);
ChartFrame frame = new ChartFrame("Optimal policy",chart);
frame.setVisible(true);
frame.setSize(500,400);
}
示例11: plotOptimalPolicyAction
import org.jfree.chart.ChartFrame; //导入方法依赖的package包/类
static void plotOptimalPolicyAction(int targetPeriod, BackwardRecursionImpl recursion){
XYSeries series = new XYSeries("Optimal policy");
for(double i = StateImpl.getMinState(); i <= StateImpl.getMaxState(); i += StateImpl.getStepSize()){
StateDescriptorImpl stateDescriptor = new StateDescriptorImpl(targetPeriod, i);
series.add(i,recursion.getOptimalAction(stateDescriptor).getAction());
}
XYDataset xyDataset = new XYSeriesCollection(series);
JFreeChart chart = ChartFactory.createXYLineChart("Optimal policy - period "+targetPeriod+" order quantity", "Opening inventory level", "Order quantity",
xyDataset, PlotOrientation.VERTICAL, false, true, false);
ChartFrame frame = new ChartFrame("Optimal policy",chart);
frame.setVisible(true);
frame.setSize(500,400);
}
示例12: plotOptimalPolicyCost
import org.jfree.chart.ChartFrame; //导入方法依赖的package包/类
static void plotOptimalPolicyCost(int targetPeriod, BackwardRecursionImpl recursion){
recursion.runBackwardRecursionMonitoring(targetPeriod);
XYSeries series = new XYSeries("Optimal policy");
for(double i = StateImpl.getMinState(); i <= StateImpl.getMaxState(); i += StateImpl.getStepSize()){
StateDescriptorImpl stateDescriptor = new StateDescriptorImpl(targetPeriod, i);
series.add(i,recursion.getExpectedCost(stateDescriptor));
}
XYDataset xyDataset = new XYSeriesCollection(series);
JFreeChart chart = ChartFactory.createXYLineChart("Optimal policy policy - period "+targetPeriod+" expected total cost", "Opening inventory level", "Expected total cost",
xyDataset, PlotOrientation.VERTICAL, false, true, false);
ChartFrame frame = new ChartFrame("Optimal policy",chart);
frame.setVisible(true);
frame.setSize(500,400);
}
示例13: jPieChart
import org.jfree.chart.ChartFrame; //导入方法依赖的package包/类
public ChartFrame jPieChart(String[] categories, double[] values, String chartTitle) {
DefaultPieDataset data = new DefaultPieDataset();
for (int k = 0; k < values.length; k++)
data.setValue(categories[k], values[k]);
m_chart = ChartFactory.createPieChart(chartTitle, data, true, true, true);
ChartFrame cf = new ChartFrame("Pie Chart", m_chart);
cf.setSize(defaultXSize, defaultYSize);
cf.setVisible(true);
return cf;
}
示例14: graficarCategoria
import org.jfree.chart.ChartFrame; //导入方法依赖的package包/类
public void graficarCategoria() {
// este es el que anda "bien"
int TProf = 0;
String TProf2 = txtTotalProf.getText();
int TId = 0;
String TId2 = txtTotalIdoneo.getText();
int TAInf = 0;
String TAInf2 = txtTotalAInfor.getText();
DefaultPieDataset pieDataset = new DefaultPieDataset();
if (txtTotalProf.getText().equals("")) {
TProf = 0;
txtTotalProf.setText(String.valueOf(TId));
pieDataset.setValue("Profesional", new Integer(TProf));
} else {
pieDataset.setValue("Profesional", new Integer(TProf2));
}
if (txtTotalIdoneo.getText().equals("")) {
TId = 0;
txtTotalIdoneo.setText(String.valueOf(TId));
pieDataset.setValue("Idoneo", new Integer(TId));
} else {
pieDataset.setValue("Idoneo", new Integer(TId2));
}
if (txtTotalAInfor.getText().equals("")) {
TAInf = 0;
txtTotalAInfor.setText(String.valueOf(TAInf));
pieDataset.setValue("Auxiliar Informatico", new Integer(TAInf));
} else {
pieDataset.setValue("Auxiliar Informatico", new Integer(TAInf2));
}
JFreeChart chart = ChartFactory.createPieChart3D("Categoria de los Socios", pieDataset, true, true, true);
PiePlot3D p = (PiePlot3D) chart.getPlot();
ChartFrame frame = new ChartFrame("Grafico de Torta", chart);
frame.setVisible(true);
frame.setSize(700, 500);
}
示例15: plotCostFunction
import org.jfree.chart.ChartFrame; //导入方法依赖的package包/类
public static void plotCostFunction(int targetPeriod,
double fixedOrderingCost,
double proportionalOrderingCost,
double holdingCost,
double penaltyCost,
Distribution[] distributions,
double minDemand,
double maxDemand,
boolean printCostFunctionValues,
boolean latexOutput,
sS_StateSpaceSampleIterator.SamplingScheme samplingScheme,
int maxSampleSize){
sS_BackwardRecursion recursion = new sS_BackwardRecursion(distributions,
minDemand,
maxDemand,
fixedOrderingCost,
proportionalOrderingCost,
holdingCost,
penaltyCost,
samplingScheme,
maxSampleSize);
recursion.runBackwardRecursion(targetPeriod);
XYSeries series = new XYSeries("(s,S) policy");
for(double i = sS_State.getMinInventory(); i <= sS_State.getMaxInventory(); i += sS_State.getStepSize()){
sS_StateDescriptor stateDescriptor = new sS_StateDescriptor(targetPeriod, sS_State.inventoryToState(i));
series.add(i,recursion.getExpectedCost(stateDescriptor));
if(printCostFunctionValues)
System.out.println(i+"\t"+recursion.getExpectedCost(stateDescriptor));
}
XYDataset xyDataset = new XYSeriesCollection(series);
JFreeChart chart = ChartFactory.createXYLineChart("(s,S) policy - period "+targetPeriod+" expected total cost", "Opening inventory level", "Expected total cost",
xyDataset, PlotOrientation.VERTICAL, false, true, false);
ChartFrame frame = new ChartFrame("(s,S) policy",chart);
frame.setVisible(true);
frame.setSize(500,400);
if(latexOutput){
try {
XYLineChart lc = new XYLineChart("(s,S) policy", "Opening inventory level", "Expected total cost", new XYSeriesCollection(series));
File latexFolder = new File("./latex");
if(!latexFolder.exists()){
latexFolder.mkdir();
}
Writer file = new FileWriter("./latex/graph.tex");
file.write(lc.toLatex(8, 5));
file.close();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}