Example usage for org.jfree.chart.renderer.category LineAndShapeRenderer getSeriesPaint

List of usage examples for org.jfree.chart.renderer.category LineAndShapeRenderer getSeriesPaint

Introduction

In this page you can find the example usage for org.jfree.chart.renderer.category LineAndShapeRenderer getSeriesPaint.

Prototype

public Paint getSeriesPaint(int series) 

Source Link

Document

Returns the paint used to color an item drawn by the renderer.

Usage

From source file:edu.uara.wrappers.customcharts.CustomLineChart.java

/**
 * get series color//from   w w  w  . jav  a2s.  co  m
 * @param series: index of series
 * @return: color of provided series
 */
@Override
public Color getSeriesColor(int series) {
    CategoryPlot plot = (CategoryPlot) chart.getPlot();
    LineAndShapeRenderer renderer = (LineAndShapeRenderer) plot.getRenderer();
    return (Color) renderer.getSeriesPaint(series);
}

From source file:org.operamasks.faces.render.graph.LineChartRenderer.java

private void setSeriesLineStyles(LineAndShapeRenderer renderer, UIChart comp, int index, UIDataItem item) {
    Boolean drawLines = item.getDrawLines();
    if (drawLines != null) {
        renderer.setSeriesLinesVisible(index, drawLines);
    }//www  . j a v  a2s .  c om

    Float lineWidth = item.getLineWidth();
    LineStyleType lineStyle = item.getLineStyle();
    if (lineWidth == null)
        lineWidth = comp.getLineWidth();
    if (lineStyle == null)
        lineStyle = comp.getLineStyle();
    if (lineWidth != null || lineStyle != null) {
        if (lineWidth == null)
            lineWidth = 1.0f;
        renderer.setSeriesStroke(index, createLineStroke(lineWidth, lineStyle));
    }

    Boolean drawMarkers = item.getDrawMarkers();
    if (drawMarkers != null) {
        renderer.setSeriesShapesVisible(index, drawMarkers);
    }

    Boolean fillMarkers = item.getFillMarkers();
    if (fillMarkers != null) {
        renderer.setSeriesShapesFilled(index, fillMarkers);
    }

    Paint markerFillColor = item.getMarkerFillColor();
    if (markerFillColor == null) {
        markerFillColor = comp.getMarkerFillColor();
        if (markerFillColor == null)
            markerFillColor = renderer.getSeriesPaint(index);
    }
    renderer.setSeriesFillPaint(index, markerFillColor);
}