#59 No option for "linespoints" type for chart

cewolf-0.8
open
nobody
TagLibrary (33)
5
2013-01-13
2005-01-19
No

*** this is an enhancement request, not a bug ***

Tha graph shown on first page of tutorial at
http://cewolf.sourceforge.net/tutorial.html shows the
data plotted such that both lines and points are seen.
However the taglib has only "line" option for the
cewolf:chart tag's type attribute which does not
display the graph as shown in the tutorial.

There should be a way to specify something like
"linespoints" type which will display both: points for
the data values and lines connecting the points.

Discussion

  • Tom Porter

    Tom Porter - 2005-02-01

    Logged In: YES
    user_id=1209832

    I was able to accomplish this with Cewolf by implementing the
    ChartPostProcessor interface. I use a timeseries chart type
    and wrote a custom ChartProcessor. It grabs the chart's
    renderer from the chart's XYPlot. It then sets the renderer's
    shape to a new ellispe and set the renderer to plot shapes.
    With this method most any JFreeChart method can be used
    on the chart object that has been created via Cewolf.

     
  • Trevor Harmon

    Trevor Harmon - 2005-06-23

    Logged In: YES
    user_id=720008

    I agree that this is a major shortcoming of CeWolf. A new "linespoints"
    chart type would be a nice improvement to fix this problem. However, as
    dragontome says, there is a fairly easy workaround. Here is some
    sample code that shows how it is done.

    First, create a post processor class, like this:

    public class MyPostProcessor implements ChartPostProcessor
    {
    public void processChart(Object c, Map params)
    {
    JFreeChart chart = (JFreeChart) c;
    chart.getXYPlot().setRenderer(new XYLineAndShapeRenderer
    ());
    }
    }

    Then, in your action class, put this post processor in the session:

    request.setAttribute(
    "postProcessor",
    new MyPostProcessor());

    Finally, in the JSP, add a reference to the post processor:

    <cewolf:chartpostprocessor id="postProcessor"/>

    All of the above are incomplete snippets, of course, but they should get
    you started. By the way, note that only certain line chart types will work.
    For example, TimeSeries does, but Category does not (because its plot
    is of type CategoryPlot, not XYPlot).

     

Log in to post a comment.