5 Replies Latest reply on Nov 14, 2011 6:57 PM by itays100

    Chart and (X,Y) value tooltip

    yanmania

      Is it possible to display a tooltip on the even onmouseover under a chart (linechart, bar chart, etc.) with the (X,Y) value of the chart ?


      For exemple, when the user over the chart with his mouse he would see this kind inf information in a tooltip :


      X-axis label:2007
      Y-axis label:40 $

        • 1. Re: Chart and (X,Y) value tooltip
          yanmania

          I find something that could be interesting while looking to the JFreeChart demo coolection (http://www.jfree.org/jfreechart/jfreechart-1.0.12-demo.jnlp). It is the exemple CrosshairDemo1 and CrosshairDemo1 under folder JFreeChart/Miscellaneous/Crosshairs

          • 2. Re: Chart and (X,Y) value tooltip
            yanmania

            Hi,


            I find a way to insert tooltips on a JFreechart chart which is display by an HTML page :


            The tooltip can be created by a class which extends org.jfree.chart.labels.XYToolTipGenerator. Then ServletUtilities.saveChartAsPNG to have the image in the web context then ChartUtilities.writeImageMap to generate a map (map tag of HTML)


            JFreechart use overlib so you will have to include overlib in the seam distribution (www.bosrup.com/web/overlib/).

            • 3. Re: Chart and (X,Y) value tooltip
              yanmania

              Sorry for the multiple post. I have juste created a JIRA issue for this feature : Seam JIRA issue

              • 4. Re: Chart and (X,Y) value tooltip
                norman

                I haven't looked into how easy/hard to implement it will be, but I like the idea. 

                • 5. Re: Chart and (X,Y) value tooltip
                  itays100

                  Hi Yan, that's an old post but I have exactly the same issue and hopefully you can share with me some info.


                  In the My Link you will see an example that I have used in my seam application.
                  I able to see the chart but the map not generated and so the tooltips.


                  You mention that:
                  JFreechart use overlib so you will have to include overlib in the seam distribution (www.bosrup.com/web/overlib/).


                  I copies all the js files which I download and put the following row in my xhtml head:


                  <script type="text/javascript" src="js/overlib421/overlib.js"></script>

                  I am not sure that I need to do it anyway.
                  But the first thing is to see the generated map.
                  Any recommendations ? THnaks