Java Code Examples for org.jfree.chart.plot.Marker#setStroke()

The following examples show how to use org.jfree.chart.plot.Marker#setStroke() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ChartFormatter.java    From nmonvisualizer with Apache License 2.0 6 votes vote down vote up
public void formatMarker(Marker marker, boolean horizontal, int offset) {
    marker.setStroke(ANNOTATION_STROKE);
    marker.setPaint(annotationColor);
    marker.setLabelFont(ANNOTATION_FONT);
    marker.setLabelPaint(annotationColor);

    if (horizontal) {
        // 50 to move data to the right of the x axis
        marker.setLabelOffset(new RectangleInsets(-5, offset + 50, 5, 5));
        marker.setLabelTextAnchor(TextAnchor.TOP_CENTER);
    }
    else {
        // -5 to move to right of line
        marker.setLabelOffset(new RectangleInsets(offset + 5, -5, 5, 5));
        marker.setLabelTextAnchor(TextAnchor.TOP_LEFT);
    }
}
 
Example 2
Source File: AbstractMarkerCustomizer.java    From jasperreports with GNU Lesser General Public License v3.0 5 votes vote down vote up
protected void configureStroke(Marker marker)
{
	Float strokeWidth = getFloatProperty(PROPERTY_STROKE_WIDTH);
	if (strokeWidth == null)
	{
		strokeWidth = 1f;
	}

	BasicStroke basicStroke = getStroke(strokeWidth);

	marker.setStroke(basicStroke);
}
 
Example 3
Source File: DefaultChartService.java    From dhis2-core with BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
/**
 * Returns a horizontal line marker for the given x value and label.
 */
private Marker getMarker( Double value, String label )
{
    Marker marker = new ValueMarker( value );
    marker.setPaint( Color.BLACK );
    marker.setStroke( new BasicStroke( 1.1f ) );
    marker.setLabel( label );
    marker.setLabelOffset( new RectangleInsets( -10, 50, 0, 0 ) );
    marker.setLabelFont( SUB_TITLE_FONT );

    return marker;
}
 
Example 4
Source File: ChartImageGenerator.java    From dhis2-core with BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
/**
 * Returns a horizontal line marker for the given x value and label.
 */
private Marker getMarker(Double value, String label )
{
    Marker marker = new ValueMarker( value );
    marker.setPaint( Color.BLACK );
    marker.setStroke( new BasicStroke( 1.1f ) );
    marker.setLabel( label );
    marker.setLabelOffset( new RectangleInsets( -10, 50, 0, 0 ) );
    marker.setLabelFont( SUB_TITLE_FONT );

    return marker;
}