Example usage for org.jfree.chart.plot ValueMarker getStroke

List of usage examples for org.jfree.chart.plot ValueMarker getStroke

Introduction

In this page you can find the example usage for org.jfree.chart.plot ValueMarker getStroke.

Prototype

public Stroke getStroke() 

Source Link

Document

Returns the stroke.

Usage

From source file:org.codehaus.mojo.dashboard.report.plugin.chart.time.MarkerTimeChartDecorator.java

public void createChart() {

    XYPlot xyplot = (XYPlot) report.getPlot();
    // if (this.decoratedChart instanceof TimeChartRenderer ) {

    if (this.results != null && !this.results.isEmpty()) {
        Iterator iter1 = this.results.iterator();
        ValueMarker valuemarker = null;
        BlockContainer blockcontainerLabel = new BlockContainer(new ColumnArrangement());
        // blockcontainerLabel.setFrame( new LineBorder() );
        int i = 0;
        while (iter1.hasNext()) {
            Object[] item = (Object[]) iter1.next();
            Date date = (Date) item[1];
            Calendar cal = Calendar.getInstance();
            cal.setTime(date);// ww w  .  j  a v  a2s .  c o m
            cal.set(Calendar.HOUR_OF_DAY, 0);
            cal.set(Calendar.MINUTE, 0);
            cal.set(Calendar.SECOND, 0);
            valuemarker = new ValueMarker(cal.getTimeInMillis(), ChartColor.createDefaultPaintArray()[i],
                    new BasicStroke(2.0F));

            xyplot.addDomainMarker(valuemarker);
            LegendItem legendLabel = new LegendItem((String) item[0], null, null, null,
                    new Line2D.Double(-7.0, 0.0, 7.0, 0.0), valuemarker.getPaint(), valuemarker.getStroke(),
                    valuemarker.getPaint());

            blockcontainerLabel.add(createLegendItemBlock(legendLabel, i));
            i++;
        }
        createLegendBlock(blockcontainerLabel);
    }
    // }
}