Example usage for org.jfree.eastwood ChartEngine buildChart

List of usage examples for org.jfree.eastwood ChartEngine buildChart

Introduction

In this page you can find the example usage for org.jfree.eastwood ChartEngine buildChart.

Prototype

public static JFreeChart buildChart(Map params) 

Source Link

Document

Creates and returns a new <code>JFreeChart</code> instance that reflects the specified parameters (which should be equivalent to a parameter map returned by HttpServletRequest.getParameterMap() for a valid URI for the Google Chart API.

Usage

From source file:org.geotools.renderer.chart.ChartGraphicFactory.java

public Icon getIcon(Feature feature, Expression urlExpression, String format, int size) throws Exception {
    // evaluate the expression as a string, get the query params
    String url = urlExpression.evaluate(feature, String.class);
    if (!validRequest(url, format))
        return null;
    Map params = Parameters.parseQueryString(url.substring(HTTP_CHART.length()));

    // build the chart, guess its optimal size, return the icon representing it
    JFreeChart chart = ChartEngine.buildChart(params);
    int[] chartSize = computeChartSize(size, params);
    return new ImageIcon(drawChart(chart, chartSize[0], chartSize[1]));
}

From source file:org.geotools.renderer.chart.ChartGraphicFactory.java

/**
 * This method has been provided as a test utility only
 *///from w w  w  .  ja  va2 s  .  c o m
JFreeChart getChart(Feature feature, Expression urlExpression, String format, int size) throws Exception {
    // evaluate the expression as a string, get the query params
    String url = urlExpression.evaluate(feature, String.class);
    if (!validRequest(url, format))
        return null;
    Map params = Parameters.parseQueryString(url.substring(HTTP_CHART.length()));

    // build the chart, guess its optimal size, return the icon representing it
    return ChartEngine.buildChart(params);
}