4 Replies Latest reply on Nov 23, 2006 7:46 AM by Oddsy

    Chart, render offscreen data

    Oddsy Level 1
      I am having a slightly annoying issue with charting. I am trying to display only a small portion of the data bound to a line chart. I am doing this by setting the min and max values of the axes. However, when I do this, only lines between data points that fall within the min and max values are displayed. I would like the parts of lines any lines that transect the area I am displaying to appear. How can I do this?
        • 1. Re: Chart, render offscreen data
          peterent Level 2
          On the LineSeries, try adding filterData="false" and see what happens. I've not done this so I'm not certain of the outcome.
          • 2. Re: Chart, render offscreen data
            Oddsy Level 1
            Woohoooo! Works a treat. Thank you
            • 3. Re: Chart, render offscreen data
              Oddsy Level 1
              Ok, so that worked for a chart where an ActionScript-defined ArrayCollection was being used as the dataProvider.

              However, I have now also tried doing this using an ArrayCollection from an XML-populated Model. This works fine as long as the filterData property is not set to false. When you do this the following error message appears at runtime:

              TypeError: Error #1010: A term is undefined and has no properties.
              at mx.charts.chartClasses::GraphicsUtilities$/drawPolyLine()
              at mx.charts.renderers::LineRenderer/mx.charts.renderers:LineRenderer::updateDisplayList()
              at mx.skins::ProgrammaticSkin/validateDisplayList()
              at mx.managers::LayoutManager/::validateDisplayList()
              at mx.managers::LayoutManager/::doPhasedInstantiation()
              at Function/ http://adobe.com/AS3/2006/builtin::apply()
              at mx.core::UIComponent/::callLaterDispatcher2()
              at mx.core::UIComponent/::callLaterDispatcher()

              At a guess this is just a weird Flex bug, but any suggestions?

              My Code:

              <?xml version="1.0" encoding="utf-8"?>
              <mx:Application
              xmlns:mx=" http://www.adobe.com/2006/mxml"
              width="100%"
              height="100%"
              creationComplete="dataSet.send();"
              >
              <mx:HTTPService
              id="dataSet"
              url="data.xml"
              />

              <mx:Model id="resultsModel">{dataSet.lastResult.data}</mx:Model>

              <mx:Panel title="Line Chart" width="100%" height="100%">
              <mx:LineChart id="chart" dataProvider="{resultsModel.result}" showDataTips="true" width="100%" height="100%">
              <mx:series>
              <mx:LineSeries yField="profit" xField="entry" displayName="profit" form="curve" filterData="false" />
              <mx:LineSeries yField="expenses" xField="entry" displayName="expenses" filterData="false" />
              </mx:series>
              </mx:LineChart>
              </mx:Panel>

              </mx:Application>


              My XML:

              <data>
              <result>
              <entry>1</entry>
              <profit>2000</profit>
              <expenses>1500</expenses>
              <amount>450</amount>
              </result>
              <result>
              <entry>2</entry>
              <profit>1000</profit>
              <expenses>200</expenses>
              <amount>600</amount>
              </result>
              <result>
              <entry>3</entry>
              <profit>1500</profit>
              <expenses>500</expenses>
              <amount>300</amount>
              </result>
              </data>
              • 4. Chart, render offscreen data
                Oddsy Level 1
                So a solution to this problem is to set the filterData property to false after creation (not using the creationComplete event though, that doesn't work).