6 Replies Latest reply on Aug 29, 2006 2:58 PM by Delodic

    Hiding series in a chart

    Delodic
      Title says it all. I don't know how I can hide certain series in a linechart. Searched the docs and different sites, but I just can't find a method to do it. Setting the alpha of a serie to 0 is no option because the datatips will still popup.

      To make it more clear, watch [url=http://www.wowhealers.com/healbot1.40.html]this application[/url]. Clicking the black dots there also hides a certain serie.

      Thanks in advance :)
        • 1. Hiding series in a chart
          Delodic Level 1
          I can't believe that nobody here knows how to do this?

          My only idea now would be to change the dataprovider everytime, but since i'm using a lot of data for my chart that's getting messy. The right link to that application I was talking about is btw application

          I really hope you guys can help me
          • 2. Re: Hiding series in a chart
            peterent Level 2
            I think you only have two options: use the alpha as you have done and use your own function or class to handle the dataTips, preventing the ones you don't want to show up from appearing. Or remove the series from the chart (you don't have to destroy it, just remove it and it can be added back).

            The problem with the latter is that, say you have 3 clustered series so there are 3 bars showing up. If you remove a series, the other 2 bars spread out to occupy the remaining space.

            If you still want to go with the alpha solution, try setting enabled="false" on the series. I have no idea if that will work, but if it does and you have set the alpha to 0, then it should prevent the data tips from appearing and you won't have to write some function or class to handle it.
            • 3. Re: Hiding series in a chart
              Delodic Level 1
              Thanks for your reply.

              Since I'm using a linechart, the spreading problem won't be an issue. But how can I remove the series from the chart? I've tried to do something like: linechart.series.pop(); But I couldn't get it working.

              Also, I tried setting enabled="false" but the datatips still popup when your mouse goes over them.

              So I think that removing the series temporary is a good option, on the other hand I'm also planning to write a function for a custom datatip. So I don't know what will be the best option then.
              • 4. Re: Hiding series in a chart
                Delodic Level 1
                Sorry for the kick, but I'm still stuck on this one

                quote:

                Originally posted by: Delodic
                But how can I remove the series from the chart? I've tried to do something like: linechart.series.pop(); But I couldn't get it working.



                • 5. Re: Hiding series in a chart
                  peterent Level 2
                  Sorry for the delayed response.

                  I believe:

                  var series:Array = lineChart.series;
                  series.pop();
                  lineChart.series = series;

                  will do the trick.
                  • 6. Re: Hiding series in a chart
                    Delodic Level 1
                    Thanks for your reply :)

                    I forgot the last line (reassigning the series to the chart.series).
                    But I rewrote the code so now the dataprovider is just changed when recalculating the points, so problem was solved :)