4 Replies Latest reply on Apr 19, 2007 2:50 PM by cialeen

    Filter Data on the Chart

    cialeen
      Hello, all

      I am stuck with a problem again.
      My horizontal axis is DateTimeAxis. I set the FilterData to false so the chart won't filter the data which are out of range. But the problems is I still want to the chart can filter some data when the yValue of the data is null. It means there will show a gap at any time when the yValue is null. ( I set lineSeries.interpolateValues = false as well, but it doesn't work)

      I don't want to filter the arraycollection which is used for dataprovider before renderring data . Because if I do that, it won't reflect on the chart that I have filter some data.

      Anybody has any ideas?

      Thank you very much.
        • 1. Re: Filter Data on the Chart
          cws14
          Hi Cialeen,

          I'm not sure if this will help, but you could try to use a data renderer and simply check the data value for null in the renderer and if it is null, then draw the data point (not sure what chart type you are using) with an alpha value of 0. This should make it so the value point won't show up in the chart, but it won't be filtered out either - leaving a blank space in the plot area.

          For examples of chart item renderers, simply search for chart examples - there are many out there.

          Hope this helps.

          Chloe
          • 3. Re: Filter Data on the Chart
            cialeen Level 1
            Thank a lot for the replies.

            cws14, I am using the line chart. I found some examples about this topic, but the types of chart are ColumnChart and PieChart. I am not sure about the how to render line data item.

            So do you mean I need to write a custom itemrender to draw the specified data point and the two lines (which connect to this data point) with alpha values of 0??

            Thank you very much again.


            • 4. Re: Filter Data on the Chart
              cialeen Level 1
              Hi,

              I tried to use itemRenderer to implement it. But because I am using line chart, it does not work at all. The only thing I can do with itemRenderer is just to change the graphics of this data point. If I set the alpha of this data point to 0, it will make no change to the appearance of line chart.

              All I want is if there is an invalid data, the line chart will show a gap at that point and there is no line interpolating to its left and right data points.

              Please help me out!!