private JFreeChart initializeTimeSeriesChart() { String title = null; String xLabel = "Date"; String yLabel = ""; XYDataset data = null; boolean isCreateLegend = false; boolean isCreateTooltips = true; boolean isCreateURLs = true; return ChartFactory.createTimeSeriesChart(title, xLabel, yLabel, data, isCreateLegend, isCreateTooltips, isCreateURLs); }
public static JFreeChart createTimeSeriesChart(String title, String timeAxisLabel, String valueAxisLabel, XYDataset dataset, boolean legend, boolean tooltips, boolean urls) { JFreeChart chart = ChartFactory.createTimeSeriesChart(title, timeAxisLabel, valueAxisLabel, dataset, legend, tooltips, urls); setTimeSeriesChartDefaults(chart); return chart; }
public void initialize ( ) { if ( !ready ) { chart = ChartFactory.createTimeSeriesChart( plotTitle , "Time" , verticalAxisTitle , dataCollectionForTheChart , true , true , false ); chart.setBorderVisible( true ); ready = true; logger.debug( "The Chart Virtual Sensor is ready." ); } }
private static void displayTimeSeries(TSCollection dataset, String name, String xname, String yname) { final JFreeChart chart = ChartFactory.createTimeSeriesChart(name, xname, yname, dataset, true, false, false); final ChartPanel panel = new ChartPanel(chart); panel.setFillZoomRectangle(true); final JFrame j = new JFrame(); j.setContentPane(panel); j.pack(); j.setVisible(true); j.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); }
private static void displayTimeSeries(TSCollection dataset, String name, String xname, String yname) { final JFreeChart chart = ChartFactory.createTimeSeriesChart(name, xname, yname, dataset, true, false, false); final ChartPanel panel = new ChartPanel(chart); panel.setFillZoomRectangle(true); final JFrame j = new JFrame(); j.setContentPane(panel); j.pack(); j.setVisible(true); j.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); }
private static void displayTimeSeries(TimeSeriesCollection dataset, String name, String xname, String yname) { final JFreeChart chart = ChartFactory.createTimeSeriesChart(name, xname, yname, dataset, true, false, false); final ChartPanel panel = new ChartPanel(chart); panel.setFillZoomRectangle(true); final JFrame j = new JFrame(); j.setContentPane(panel); j.pack(); j.setVisible(true); j.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); }
private static void displayTimeSeries(TimeSeriesCollection dataset, String name, String xname, String yname) { final JFreeChart chart = ChartFactory.createTimeSeriesChart(name, xname, yname, dataset, true, false, false); final ChartPanel panel = new ChartPanel(chart); panel.setFillZoomRectangle(true); final JFrame j = new JFrame(); j.setContentPane(panel); j.pack(); j.setVisible(true); j.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); }
private static void displayTimeSeries(TSCollection dataset, String name, String xname, String yname) { final JFreeChart chart = ChartFactory.createTimeSeriesChart(name, xname, yname, dataset, true, false, false); final ChartPanel panel = new ChartPanel(chart); panel.setFillZoomRectangle(true); final JFrame j = new JFrame(); j.setContentPane(panel); j.pack(); j.setVisible(true); j.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); }
private static void displayTimeSeries(TSCollection dataset, String name, String xname, String yname) { final JFreeChart chart = ChartFactory.createTimeSeriesChart(name, xname, yname, dataset, true, false, false); final ChartPanel panel = new ChartPanel(chart); panel.setFillZoomRectangle(true); final JFrame j = new JFrame(); j.setContentPane(panel); j.pack(); j.setVisible(true); j.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); }
private void renderResponseChart( XYDataset dataset, String name, double max ) throws IOException { String title = bundle.getString( "chronos.label.responsetimes" ); String xLabel = bundle.getString( "chronos.label.responsetimes.historytime" ); String yLabel = bundle.getString( "chronos.label.responsetimes.responsetime" ); JFreeChart chart = ChartFactory.createTimeSeriesChart( title, xLabel, yLabel, dataset, true, true, false ); /* Merged from Atlassion */ if ( max > 0 ) { ChartUtil.setUpperBound( chart, max ); } ChartUtil.setupXYPlot( chart, new SimpleDateFormat() ); renderer.renderChart( name, chart ); }
/** * Create a chart with the underlying dataset. * @return The chart. */ protected JFreeChart createChart() { XYDataset dataset = new TimeSeriesCollection(); JFreeChart chart = ChartFactory.createTimeSeriesChart("Service Quality", "ms", "score", dataset, true, true, true); chart.setNotify(true); ChartPanel panel = new ChartPanel(chart); panel.setFillZoomRectangle(true); frame = new JFrame(); JPanel content = new JPanel(new BorderLayout()); content.add(panel, BorderLayout.CENTER); frame.setContentPane(panel); frame.pack(); frame.setVisible(true); return chart; }
private XYPlot createChart(RenderingContext context) { String timespan = getTimespan(); DateTime end = timespan != null ? new DateTime(timespan.split("/")[1]) : new DateTime(); // String zoneName = getTimezone().getID(); String zoneName = getTimezone().getShortName(end.getMillis(), i18n.getLocale()); StringBuilder domainAxisLabel = new StringBuilder(i18n.get("time")); domainAxisLabel.append(" (") .append(zoneName) .append(")"); boolean legend = getChartStyleDefinitions().isLegend(); chart = createTimeSeriesChart(null, domainAxisLabel.toString(), i18n.get("value"), null, legend, showTooltips, true); return createPlotArea(chart); }
private XYPlot createChart(IoStyleContext styleContext) { String timespan = getTimespan(); DateTime end = new DateTime(timespan.split("/")[1]); String zoneName = getTimezone().getShortName(end.getMillis(), i18n.getLocale()); StringBuilder domainAxisLabel = new StringBuilder(i18n.get("msg.io.chart.time")); domainAxisLabel.append(" (") .append(zoneName) .append(")"); IoParameters parameters = getParameters(); boolean showLegend = parameters.isLegend(); jFreeChart = ChartFactory.createTimeSeriesChart(null, domainAxisLabel.toString(), i18n.get("msg.io.chart.value"), null, showLegend, false, true); return createPlotArea(jFreeChart); }
@Override public JFreeChart createChart(FacesContext context) { return ChartFactory.createTimeSeriesChart(getTitle(), getDomainAxisLabel(), getRangeAxisLabel(), (XYDataset) getDataset(), true, false, false); }
public static JFreeChart createTimeSeriesChart(String title, List<TimeSeriesChartSpecification> specifications, String xLabel, String yLabel, ColorTheme theme) { TimeSeriesCollection dataCollection = new TimeSeriesCollection(); for (TimeSeriesChartSpecification specification : specifications) { TimeSeries series = new TimeSeries(specification.getLabel(), Millisecond.class); for (Map.Entry<Date, Double> point : specification.getData().entrySet()) { series.add(new Millisecond(point.getKey()), point.getValue()); } dataCollection.addSeries(series); } JFreeChart chart = ChartFactory.createTimeSeriesChart(title, xLabel, yLabel, dataCollection, true, false, false); formatColorTheme(chart, theme); XYPlot plot = chart.getXYPlot(); Color[] colors = generateJetSpectrum(specifications.size()); for (int i = 0; i < specifications.size(); i++) { plot.getRenderer().setSeriesPaint(i, colors[i]); } DateAxis axis = (DateAxis) plot.getDomainAxis(); axis.setDateFormatOverride(new SimpleDateFormat("dd/MM hh:mm:ss")); return chart; }
protected JFreeChart createChart(XYDataset dataset) { JFreeChart jfreechart = ChartFactory.createTimeSeriesChart( null, "time", "# of issues", dataset, true, false, false); jfreechart.setBackgroundPaint(Color.WHITE); XYPlot plot = (XYPlot)jfreechart.getPlot(); XYStepAreaRenderer renderer = new XYStepAreaRenderer(); plot.setRenderer(renderer); renderer.setSeriesPaint(0,ColorPalette.RED); renderer.setSeriesPaint(1,ColorPalette.GREEN); return jfreechart; } }
public JFreeChart createChart(Chart chart) { ChartModel model = (ChartModel) chart.getModel(); if (!(model instanceof XYModel)) { throw new UiException("model must be a org.zkoss.zul.XYModel"); } final JFreeChart jchart = ChartFactory.createTimeSeriesChart( chart.getTitle(), chart.getXAxis(), chart.getYAxis(), XYModelToTimeDataset((XYModel)model, chart), chart.isShowLegend(), chart.isShowTooltiptext(), true); setupDateAxis(jchart, chart); return jchart; } }
private static JFreeChart createJFreeChart(final String chartName, final String uom, final XYDataset timeseriescollection) { JFreeChart jfreechart = ChartFactory.createTimeSeriesChart(chartName, "Time", uom, timeseriescollection, true, true, false); XYPlot xyplot = (XYPlot) jfreechart.getPlot(); DateAxis dateaxis = (DateAxis) xyplot.getDomainAxis(); dateaxis.setVerticalTickLabels(true); XYLineAndShapeRenderer xylineandshaperenderer = (XYLineAndShapeRenderer) xyplot.getRenderer(); xylineandshaperenderer.setBaseShapesVisible(true); xylineandshaperenderer.setUseFillPaint(true); xylineandshaperenderer.setLegendItemToolTipGenerator(new StandardXYSeriesLabelGenerator("Tooltip {0}")); return jfreechart; }
private JFreeChart createChart(final XYDataset dataset) { JFreeChart result = ChartFactory.createTimeSeriesChart( null, // No title - it just takes up space Constant.messages.getString("ascan.progress.chart.time"), Constant.messages.getString("ascan.progress.chart.responses"), dataset, true, true, false ); XYPlot plot = result.getXYPlot(); ValueAxis daxis = plot.getDomainAxis(); daxis.setAutoRange(true); daxis.setAutoRangeMinimumSize(60000.0); plot.getRangeAxis().setAutoRangeMinimumSize(20); return result; }
public JFreeChart render(Chart ofxChart) { this.ofxChart=ofxChart; setTimePeriod(); chart = ChartFactory.createTimeSeriesChart( ChartLabelResolver.getTitle(ofxChart), null, null, createDataset(ofxChart.getDataSet()), ofxChart.isLegend(), true, false ); setColors(); setGrid(); setAxis(); return chart; }