List of usage examples for org.jfree.chart JFreeChart JFreeChart
public JFreeChart(String title, Font titleFont, Plot plot, boolean createLegend)
From source file:com.pureinfo.srm.reports.impl.MyChartFactory.java
public static JFreeChart createBarChart3D(String title, String categoryAxisLabel, String valueAxisLabel, CategoryDataset dataset, PlotOrientation orientation, boolean legend, boolean tooltips, boolean urls) { if (orientation == null) { throw new IllegalArgumentException("Null 'orientation' argument."); }/* w w w . ja v a 2 s .c om*/ CategoryAxis categoryAxis = new CategoryAxis3D(categoryAxisLabel); ValueAxis valueAxis = new NumberAxis3D(valueAxisLabel); BarRenderer3D renderer = new BarRenderer3D() { /** * @see org.jfree.chart.renderer.AbstractRenderer#getItemPaint(int, int) */ public Paint getItemPaint(int _nRow, int _nColumn) { return getSeriesPaint(_nColumn); } }; if (tooltips) { renderer.setBaseToolTipGenerator(new StandardCategoryToolTipGenerator()); } if (urls) { renderer.setBaseItemURLGenerator(new StandardCategoryURLGenerator()); } CategoryPlot plot = new CategoryPlot(dataset, categoryAxis, valueAxis, renderer); plot.setOrientation(orientation); if (orientation == PlotOrientation.HORIZONTAL) { // change rendering order to ensure that bar overlapping is the // right way around plot.setRowRenderingOrder(SortOrder.DESCENDING); plot.setColumnRenderingOrder(SortOrder.DESCENDING); } plot.setForegroundAlpha(0.75f); JFreeChart chart = new JFreeChart(title, JFreeChart.DEFAULT_TITLE_FONT, plot, legend); return chart; }
From source file:es.bsc.autonomic.powermodeller.graphics.TotalPowerVsTotalPrediction.java
public static JPanel createPanel() { //Axis configuration NumberAxis sampleAxis = new NumberAxis("Sample"); sampleAxis.setAutoRangeIncludesZero(false); NumberAxis powerAxis = new NumberAxis("Power (Watts)"); powerAxis.setAutoRangeIncludesZero(false); XYSplineRenderer xysplinerenderer = new XYSplineRenderer(); XYPlot xyplot = new XYPlot(data, sampleAxis, powerAxis, xysplinerenderer); for (int i = 0; i < data.getSeriesCount(); i++) { xyplot.getRenderer().setSeriesShape(i, new Rectangle()); }/* ww w . ja va 2 s.c o m*/ //Panel layout configuration xyplot.setBackgroundPaint(Color.lightGray); xyplot.setDomainGridlinePaint(Color.white); xyplot.setRangeGridlinePaint(Color.white); xyplot.setAxisOffset(new RectangleInsets(4D, 4D, 4D, 4D)); JFreeChart jfreechart = new JFreeChart(NAME, JFreeChart.DEFAULT_TITLE_FONT, xyplot, true); ChartUtilities.applyCurrentTheme(jfreechart); ChartPanel chartpanel = new ChartPanel(jfreechart); return chartpanel; }
From source file:msi.gama.outputs.layers.charts.ChartJFreeChartOutputRadar.java
@Override public void createChart(final IScope scope) { super.createChart(scope); final SpiderWebPlot plot = new SpiderWebPlot((CategoryDataset) createDataset(scope)); chart = new JFreeChart(getName(), null, plot, true); }
From source file:org.sonar.server.charts.deprecated.SparkLinesChart.java
public SparkLinesChart(Map<String, String> params) { super(params); jfreechart = new JFreeChart(null, TextTitle.DEFAULT_FONT, new XYPlot(), false); }
From source file:org.quickserver.net.qsadmin.plugin.stats.MeterChart.java
public MeterChart(String title) { data = new DefaultValueDataset(0.0); meterplot = new MeterPlot(data); range = new Range(0, 20000); bgColor = new Color(238, 238, 230, 255); meterplot.setRange(range);/*from ww w . jav a2s . c om*/ meterplot.setNormalRange(new Range(0, 4000)); meterplot.setWarningRange(new Range(4000, 9000)); meterplot.setCriticalRange(new Range(9000, 20000)); meterplot.setUnits(""); meterplot.setDrawBorder(false); meterplot.setInsets(new Insets(2, 2, 2, 2)); meterchart = new JFreeChart(title + " Meter", JFreeChart.DEFAULT_TITLE_FONT, meterplot, false); meterchart.setBackgroundPaint(bgColor); panelMeter = new ChartPanel(meterchart); setLayout(new BorderLayout()); add(panelMeter, BorderLayout.CENTER); }
From source file:org.operamasks.faces.render.graph.RadarChartRenderer.java
protected JFreeChart createChart(UIChart comp) { Dataset dataset = createDataset(comp); JFreeChart chart = null;/*from w ww. j a v a 2 s . c o m*/ if (dataset instanceof CategoryDataset) { SpiderWebPlot plot = new SpiderWebPlot((CategoryDataset) dataset); plot.setWebFilled(false); Object startAngle = comp.getAttributes().get("startAngle"); if (startAngle != null) { plot.setStartAngle(Coercion.coerceToDouble(startAngle)); } if (comp.isShowItemTips()) { plot.setToolTipGenerator(new StandardCategoryToolTipGenerator()); } chart = new JFreeChart(null, null, plot, false); } return chart; }
From source file:de.berlios.statcvs.xml.chart.AbstractCombinedChart.java
/** * @param settings/* w w w .j a v a 2 s.c o m*/ * @param defaultFilename * @param defaultSubtitle */ public AbstractCombinedChart(ReportSettings settings, String defaultFilename, String defaultSubtitle) { super(settings, defaultFilename, defaultSubtitle); ValueAxis domainAxis = new DateAxis(I18n.tr("Date")); domainAxis.setVerticalTickLabels(true); combinedPlot = new CombinedDomainXYPlot(domainAxis); combinedPlot.setGap(10); combinedPlot.setOrientation(PlotOrientation.VERTICAL); JFreeChart chart = new JFreeChart(settings.getProjectName(), JFreeChart.DEFAULT_TITLE_FONT, combinedPlot, false); setChart(chart); }
From source file:org.sonar.server.charts.deprecated.BarChart.java
public BarChart(Map<String, String> params) { super(params); jfreechart = new JFreeChart(null, TextTitle.DEFAULT_FONT, new CategoryPlot(), false); }
From source file:jesse.GA_ANN.DataVis.java
JFreeChart createChart()//Here Input MillSecond { total = new XYSeries[10]; XYSeriescollection = new XYSeriesCollection(); for (int i = 0; i < 10; i++) { total[i] = new XYSeries(i); XYSeriescollection.addSeries(total[i]); }//from www . jav a 2s . com dateaxis = new NumberAxis("Time"); NumberAxis Conaxis = new NumberAxis("z??"); dateaxis.setAutoRange(true); dateaxis.setLowerMargin(0.0D); dateaxis.setUpperMargin(0.0D); dateaxis.setTickLabelsVisible(true); xylineandshaperenderer = new XYLineAndShapeRenderer(true, false); xylineandshaperenderer.setSeriesPaint(0, Color.green); xylineandshaperenderer.setSeriesStroke(0, new BasicStroke(1F, 0, 2)); xylineandshaperenderer.setFillPaint(new Color(30, 30, 220), true); Conaxis.setRange(-1, 1); Conaxis.setAutoRange(true); Conaxis.setAutoRangeIncludesZero(false); XYPlot xyplot = new XYPlot(XYSeriescollection, dateaxis, Conaxis, xylineandshaperenderer); JFreeChart jfreechart = new JFreeChart("time-z", new Font("Arial", 1, 24), xyplot, true); ChartUtilities.applyCurrentTheme(jfreechart); ChartPanel chartpanel = new ChartPanel(jfreechart, true); chartpanel.setBorder(BorderFactory.createCompoundBorder(BorderFactory.createEmptyBorder(4, 4, 4, 4), BorderFactory.createLineBorder(Color.black))); return jfreechart; }
From source file:jgnash.ui.report.compiled.SecurityHighLowChart.java
private static JFreeChart createHighLowChart(String title, String timeAxisLabel, String valueAxisLabel, AbstractXYDataset data, boolean legend) { ValueAxis timeAxis = new DateAxis(timeAxisLabel); NumberAxis valueAxis = new NumberAxis(valueAxisLabel); valueAxis.setAutoRangeIncludesZero(false); HighLowRenderer renderer = new HighLowRenderer(); renderer.setBaseToolTipGenerator(new HighLowItemLabelGenerator()); XYPlot plot = new XYPlot(data, timeAxis, valueAxis, renderer); return new JFreeChart(title, JFreeChart.DEFAULT_TITLE_FONT, plot, legend); }