List of usage examples for org.jfree.chart ChartFactory createWindPlot
public static JFreeChart createWindPlot(String title, String xAxisLabel, String yAxisLabel, WindDataset dataset, boolean legend, boolean tooltips, boolean urls)
From source file:com.thecoderscorner.groovychart.chart.WindplotChart.java
public JFreeChart createChart() { JFreeChart chart = ChartFactory.createWindPlot(this.getTitle(), this.getXAxisLabel(), this.getYAxisLabel(), (WindDataset) this.getDataset(), this.isLegend(), this.isTooltips(), this.isUrls()); return setExtraProperties(chart); }
From source file:org.jfree.chart.demo.WindChartDemo1.java
private static JFreeChart createChart(WindDataset winddataset) { JFreeChart jfreechart = ChartFactory.createWindPlot("Wind Chart Demo", "Date", "Direction / Force", winddataset, true, false, false); return jfreechart; }
From source file:org.jfree.chart.demo.WindChartDemo.java
/** * Creates a chart./* w w w . j a v a2 s .c o m*/ * * @param dataset the dataset. * * @return The chart. */ private JFreeChart createChart(final WindDataset dataset) { final JFreeChart chart = ChartFactory.createWindPlot("Wind Chart Demo", "Date", "Direction / Force", dataset, true, false, false); // then customise it a little... chart.setBackgroundPaint(new GradientPaint(0, 0, Color.white, 1000, 0, Color.green)); return chart; }
From source file:de.laures.cewolf.taglib.CewolfChartFactory.java
public static JFreeChart getChartInstance(String chartType, String title, String xAxisLabel, String yAxisLabel, Dataset data) throws ChartValidationException { // first check the dynamically registered chart types CewolfChartFactory factory = (CewolfChartFactory) factories.get(chartType); if (factory != null) { // custom factory found, use it return factory.getChartInstance(title, xAxisLabel, yAxisLabel, data); }//w w w .j a v a 2 s. c o m switch (getChartTypeConstant(chartType)) { case XY: check(data, XYDataset.class, chartType); return ChartFactory.createXYLineChart(title, xAxisLabel, yAxisLabel, (XYDataset) data, PlotOrientation.VERTICAL, true, true, true); case PIE: check(data, PieDataset.class, chartType); return ChartFactory.createPieChart(title, (PieDataset) data, true, true, true); case AREA_XY: check(data, XYDataset.class, chartType); return ChartFactory.createXYAreaChart(title, xAxisLabel, yAxisLabel, (XYDataset) data, PlotOrientation.VERTICAL, true, false, false); case SCATTER: check(data, XYDataset.class, chartType); return ChartFactory.createScatterPlot(title, xAxisLabel, yAxisLabel, (XYDataset) data, PlotOrientation.VERTICAL, true, false, false); case AREA: check(data, CategoryDataset.class, chartType); return ChartFactory.createAreaChart(title, xAxisLabel, yAxisLabel, (CategoryDataset) data, PlotOrientation.VERTICAL, true, false, false); case HORIZONTAL_BAR: check(data, CategoryDataset.class, chartType); return ChartFactory.createBarChart(title, xAxisLabel, yAxisLabel, (CategoryDataset) data, PlotOrientation.HORIZONTAL, true, false, false); case HORIZONTAL_BAR_3D: check(data, CategoryDataset.class, chartType); return ChartFactory.createBarChart3D(title, xAxisLabel, yAxisLabel, (CategoryDataset) data, PlotOrientation.HORIZONTAL, true, false, false); case LINE: check(data, CategoryDataset.class, chartType); return ChartFactory.createLineChart(title, xAxisLabel, yAxisLabel, (CategoryDataset) data, PlotOrientation.VERTICAL, true, false, false); case STACKED_HORIZONTAL_BAR: check(data, CategoryDataset.class, chartType); return ChartFactory.createStackedBarChart(title, xAxisLabel, yAxisLabel, (CategoryDataset) data, PlotOrientation.HORIZONTAL, true, false, false); case STACKED_VERTICAL_BAR: check(data, CategoryDataset.class, chartType); return ChartFactory.createStackedBarChart(title, xAxisLabel, yAxisLabel, (CategoryDataset) data, PlotOrientation.VERTICAL, true, false, false); case STACKED_VERTICAL_BAR_3D: check(data, CategoryDataset.class, chartType); return ChartFactory.createStackedBarChart3D(title, xAxisLabel, yAxisLabel, (CategoryDataset) data, PlotOrientation.VERTICAL, true, false, false); case VERTICAL_BAR: check(data, CategoryDataset.class, chartType); return ChartFactory.createBarChart(title, xAxisLabel, yAxisLabel, (CategoryDataset) data, PlotOrientation.VERTICAL, true, false, false); case VERTICAL_BAR_3D: check(data, CategoryDataset.class, chartType); return ChartFactory.createBarChart3D(title, xAxisLabel, yAxisLabel, (CategoryDataset) data, PlotOrientation.VERTICAL, true, false, false); case TIME_SERIES: check(data, XYDataset.class, chartType); return ChartFactory.createTimeSeriesChart(title, xAxisLabel, yAxisLabel, (XYDataset) data, true, false, false); case CANDLE_STICK: check(data, OHLCDataset.class, chartType); return ChartFactory.createCandlestickChart(title, xAxisLabel, yAxisLabel, (OHLCDataset) data, true); case HIGH_LOW: check(data, OHLCDataset.class, chartType); return ChartFactory.createHighLowChart(title, xAxisLabel, yAxisLabel, (OHLCDataset) data, true); case GANTT: check(data, IntervalCategoryDataset.class, chartType); return ChartFactory.createGanttChart(title, xAxisLabel, yAxisLabel, (IntervalCategoryDataset) data, true, false, false); case WIND: check(data, WindDataset.class, chartType); return ChartFactory.createWindPlot(title, xAxisLabel, yAxisLabel, (WindDataset) data, true, false, false); //case SIGNAL : // check(data, SignalsDataset.class, chartType); // return ChartFactory.createSignalChart(title, xAxisLabel, yAxisLabel, (SignalsDataset) data, true); case VERRTICAL_XY_BAR: check(data, IntervalXYDataset.class, chartType); return ChartFactory.createXYBarChart(title, xAxisLabel, true, yAxisLabel, (IntervalXYDataset) data, PlotOrientation.VERTICAL, true, false, false); case PIE_3D: check(data, PieDataset.class, chartType); return ChartFactory.createPieChart3D(title, (PieDataset) data, true, false, false); case METER: check(data, ValueDataset.class, chartType); MeterPlot plot = new MeterPlot((ValueDataset) data); JFreeChart chart = new JFreeChart(title, plot); return chart; case STACKED_AREA: check(data, CategoryDataset.class, chartType); return ChartFactory.createStackedAreaChart(title, xAxisLabel, yAxisLabel, (CategoryDataset) data, PlotOrientation.VERTICAL, true, false, false); case BUBBLE: check(data, XYZDataset.class, chartType); return ChartFactory.createBubbleChart(title, xAxisLabel, yAxisLabel, (XYZDataset) data, PlotOrientation.VERTICAL, true, false, false); case AUSTER_CICLOS: check(data, IntervalCategoryDataset.class, chartType); return ChartFactory.createAusterCiclosChart((IntervalCategoryDataset) data); default: throw new UnsupportedChartTypeException(chartType + " is not supported."); } }
From source file:net.sf.jsfcomp.chartcreator.utils.ChartUtils.java
public static JFreeChart createChartWithXYDataSet(ChartData chartData) { XYDataset dataset = (XYDataset) chartData.getDatasource(); String type = chartData.getType(); String xAxis = chartData.getXlabel(); String yAxis = chartData.getYlabel(); boolean legend = chartData.isLegend(); JFreeChart chart = null;//from w w w . java2 s . com PlotOrientation plotOrientation = ChartUtils.getPlotOrientation(chartData.getOrientation()); if (type.equalsIgnoreCase("timeseries")) { chart = ChartFactory.createTimeSeriesChart("", xAxis, yAxis, dataset, legend, true, false); } else if (type.equalsIgnoreCase("xyline")) { chart = ChartFactory.createXYLineChart("", xAxis, yAxis, dataset, plotOrientation, legend, true, false); } else if (type.equalsIgnoreCase("polar")) { chart = ChartFactory.createPolarChart("", dataset, legend, true, false); } else if (type.equalsIgnoreCase("scatter")) { chart = ChartFactory.createScatterPlot("", xAxis, yAxis, dataset, plotOrientation, legend, true, false); } else if (type.equalsIgnoreCase("xyarea")) { chart = ChartFactory.createXYAreaChart("", xAxis, yAxis, dataset, plotOrientation, legend, true, false); } else if (type.equalsIgnoreCase("xysteparea")) { chart = ChartFactory.createXYStepAreaChart("", xAxis, yAxis, dataset, plotOrientation, legend, true, false); } else if (type.equalsIgnoreCase("xystep")) { chart = ChartFactory.createXYStepChart("", xAxis, yAxis, dataset, plotOrientation, legend, true, false); } else if (type.equalsIgnoreCase("bubble")) { chart = ChartFactory.createBubbleChart("", xAxis, yAxis, (XYZDataset) dataset, plotOrientation, legend, true, false); } else if (type.equalsIgnoreCase("candlestick")) { chart = ChartFactory.createCandlestickChart("", xAxis, yAxis, (OHLCDataset) dataset, legend); } else if (type.equalsIgnoreCase("boxandwhisker")) { chart = ChartFactory.createBoxAndWhiskerChart("", xAxis, yAxis, (BoxAndWhiskerXYDataset) dataset, legend); } else if (type.equalsIgnoreCase("highlow")) { chart = ChartFactory.createHighLowChart("", xAxis, yAxis, (OHLCDataset) dataset, legend); } else if (type.equalsIgnoreCase("histogram")) { chart = ChartFactory.createHistogram("", xAxis, yAxis, (IntervalXYDataset) dataset, plotOrientation, legend, true, false); } else if (type.equalsIgnoreCase("wind")) { chart = ChartFactory.createWindPlot("", xAxis, yAxis, (WindDataset) dataset, legend, true, false); } if (chart.getPlot() instanceof XYPlot) { chart.getXYPlot().setDomainGridlinesVisible(chartData.isDomainGridLines()); chart.getXYPlot().setRangeGridlinesVisible(chartData.isRangeGridLines()); if (chartData.getGenerateMap() != null) chart.getXYPlot().getRenderer().setURLGenerator(new StandardXYURLGenerator("")); } setXYSeriesColors(chart, chartData); setXYExtensions(chart, chartData); return chart; }
From source file:org.jfree.chart.demo.JFreeChartDemoBase.java
/** * Creates and returns a sample wind plot. * * @return a sample wind plot./*from w ww . java 2s . c o m*/ */ public JFreeChart createWindPlot() { // create a default chart based on some sample data... final String title = this.resources.getString("other.wind.title"); final String domain = this.resources.getString("other.wind.domain"); final String range = this.resources.getString("other.wind.range"); final WindDataset data = DemoDatasetFactory.createWindDataset1(); final JFreeChart chart = ChartFactory.createWindPlot(title, domain, range, data, true, false, false); // then customise it a little... chart.setBackgroundPaint(new GradientPaint(0, 0, Color.white, 1000, 0, Color.green)); return chart; }