Example usage for org.jfree.chart.util RelativeDateFormat setMinuteSuffix

List of usage examples for org.jfree.chart.util RelativeDateFormat setMinuteSuffix

Introduction

In this page you can find the example usage for org.jfree.chart.util RelativeDateFormat setMinuteSuffix.

Prototype

public void setMinuteSuffix(String suffix) 

Source Link

Document

Sets the string that is appended to the minute count.

Usage

From source file:de.tud.kom.p2psim.impl.skynet.visualization.MetricsPlot.java

private void createChartPanel(String title, long time) {
    YIntervalSeriesCollection dataset = new YIntervalSeriesCollection();
    chart = ChartFactory.createTimeSeriesChart(title, X_AXIS_TITLE, "", dataset, true, true, true);
    XYPlot plot = (XYPlot) chart.getPlot();

    DeviationRenderer errorRenderer = new DeviationRenderer();
    errorRenderer.setShapesVisible(false);
    errorRenderer.setLinesVisible(true);
    errorRenderer.setAlpha(0.0f);//w w  w .j  av a2  s .  co  m
    // errorRenderer.setDrawYError(false);
    // errorRenderer.setDrawXError(false);
    plot.setRenderer(errorRenderer);

    plot.setBackgroundPaint(Color.WHITE);
    plot.setRangeGridlinePaint(Color.DARK_GRAY);
    plot.setDomainGridlinePaint(Color.DARK_GRAY);
    upperDomainBound = (time / 1000) + ((interval - 1) * step / 1000);
    DateAxis domain = (DateAxis) plot.getDomainAxis();
    domain.setAutoRange(false);
    domain.setRange((time / 1000), upperDomainBound);
    RelativeDateFormat rdf = new RelativeDateFormat();
    rdf.setHourSuffix(":");
    rdf.setMinuteSuffix(":");
    rdf.setSecondSuffix("");
    rdf.setSecondFormatter(new DecimalFormat("0"));
    domain.setDateFormatOverride(rdf);
    plot.setDomainAxis(domain);
    plotPanel = new ChartPanel(chart, true);
    setSizeOfComponent(plotPanel, new Dimension(plotWidth, plotHeight));
    container.add(plotPanel, BorderLayout.CENTER);
    container.add(createRadioBoxes(visType == VisualizationType.Metric), BorderLayout.SOUTH);
    setSizeOfComponent(container, new Dimension(plotWidth, plotHeight + boxOffset));
}