Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

#99 showlegend does not take in the affect

cewolf-0.10
closed-fixed
nobody
Rendering (22)
5
2015-02-11
2007-08-07
Anonymous
No

I am trying to render a graph with our a legend and followings i what i am doing but it does not hide the legend. It seems like it is a bug, but i just want to make sure if it is or not? has anyone sucessfully hidden the legend?

                            <c:set var="chartId" value="investigator\_kit\_inventory\_$\{data.identity\}"/>
                            <jsp:useBean id="investigatorKitInventoryProducer" 
                                         type="InvestigatorKitInventoryProducer"    
                                         scope="session"/> 
                            <cewolf:chart id="$\{chartId\}" type="stackedhorizontalbar" showlegend="<%=Boolean.FALSE%>">
                                <cewolf:data>
                                    <cewolf:producer id="investigatorKitInventoryProducer">
                                        <cewolf:param name="identity" value="$\{data.identity\}">
                                        </cewolf:param>
                                    </cewolf:producer>                                        
                                </cewolf:data>
                            </cewolf:chart>               
                            <cewolf:img chartid="$\{chartId\}" renderer="cewolf" width="250" height="80">
                                <cewolf:map tooltipgeneratorid="investigatorKitInventoryProducer"/>
                            </cewolf:img>

Discussion

  • Ulf Dittmer
    Ulf Dittmer
    2008-02-22

    Logged In: YES
    user_id=908396
    Originator: NO

    I've put up a version of cewolf that has this bug (and a couple of other issue) fixed at http://www.ulfdittmer.com/code/cewolf.html

     
  • Logged In: NO

    I was able to resolve this issue by modifying the method removeLegend() in de.laures.cewolf.taglib.AbstractChartDefinition

    The method removes the legend by removing the LegendTitle it finds from the chart's subtitles list, which is retrieved using getSubtitles(). I noticed however that getSubtitles was returning a new ArrayList object (see org.jfree.chart.JFreeChart getSubtitles(), I was viewing JFreeChart 1.9). This being the case, removal of the LegendTitle from this new object would have no effect on the actual chart object - thus the legend isn't really removed.

    My solution was to replace the entire removeLegend() implementation with one simple call to chart.removeLegend().

    I'd like to request that someone review this solution for a possible fix to this bug and for hopefully a new cewolf release.

     
  • Ulf Dittmer
    Ulf Dittmer
    2010-07-16

    Fixed in version 1.1

     
  • Ulf Dittmer
    Ulf Dittmer
    2010-07-16

    • status: open --> closed-fixed