Loading ...
Sorry, an error occurred while loading the content.

RE: [ydn-flash] Re: Null values in more than 1 lineSeries gives error

Expand Messages
  • Lamonte Garrett
    It compiles with no errors, but its skipping the null values completely in the 2nd LineSeries. Line2 is charted as if there are NO null values at all. Shows
    Message 1 of 6 , Jan 19, 2010
    View Source
    • 0 Attachment
      It compiles with no errors, but its skipping the null values completely in the 2nd LineSeries.  Line2 is charted as if there are NO null values at all.  Shows 6 points with no spaces.

      Lamonte Garrett 
      PH: 919-413-8410




      To: ydn-flash@yahoogroups.com
      From: trippb@...
      Date: Fri, 15 Jan 2010 22:59:44 +0000
      Subject: [ydn-flash] Re: Null values in more than 1 lineSeries gives error

       
      It looks like you've found a bug. You will need to patch it in a local class file copy in your application' s directory.

      1. Copy Cartesian.as from the astra download (Source/com/ yahoo/astra/ fl/charts/ CartesianChart. as) and place it in the directory of your flash app. ([your app directory]/com/ yahoo/astra/ fl/charts/ Cartesian. as)
      2. Make the following addition to the local copy of Cartesian.as: In the combineDuplicateCat egoryNames method, (around line 1559) change:
      var item:Object = currentSeries. dataProvider[ j];
      to:
      var item:Object = currentSeries. dataProvider[ j];
      if(!item) continue;

      This should allow you to successfully compile your code now. Post back if you run into any issues.

      Tripp

      --- In ydn-flash@yahoogrou ps.com, "antwaing" <lamonteg8028@ ...> wrote:
      >
      > In the code below it works fine and has a dashed line for null values if you only have one dataProvider, but the moment you add a 2nd dataProvider( in this case "line2") with a null value it gives this error:
      >
      > "TypeError: Error #1009: Cannot access a property or method of a null object reference>"
      >
      > Any help would be great appreciated. code below.
      >
      >
      > import com.yahoo.astra. fl.charts. series.LineSerie s;
      >
      > var line2:LineSeries = new LineSeries() ;
      > var line2:LineSeries = new LineSeries() ;
      >
      > //notice that the data provider has several null values
      > line1.dataProvider = [14, 8,,, 18, 6, , 12, 24];
      > line2.dataProvider = [14, 8,,, 18, 6, , 12, 24];
      > //we want a continuous line, so we'll connect discontinuous points with a dashed line
      > line.setStyle( "connectDisconti nuousPoints" , true);
      >
      > //pass the LineSeries to the chart
      > chart.dataProvider = [line1, line2];
      >
      > //the labels on the x-axis
      > chart.categoryNames = [2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008];
      >




      Hotmail: Trusted email with Microsoft’s powerful SPAM protection. Sign up now.
    • antwaing
      I figured it out. Thanks for pointing me in the right direction. This is what I added. var item:Object = currentSeries.dataProvider[j]; if (!item){
      Message 2 of 6 , Jan 19, 2010
      View Source
      • 0 Attachment
        I figured it out. Thanks for pointing me in the right direction. This is what I added.

        var item:Object = currentSeries.dataProvider[j];
        if (!item){
        newDataProvider.push(dict[null]);
        }
        if (!item) continue;

        Thanks again

        --- In ydn-flash@yahoogroups.com, "tripp.bridges" <trippb@...> wrote:
        >
        > It looks like you've found a bug. You will need to patch it in a local class file copy in your application's directory.
        >
        > 1. Copy Cartesian.as from the astra download (Source/com/yahoo/astra/fl/charts/CartesianChart.as) and place it in the directory of your flash app. ([your app directory]/com/yahoo/astra/fl/charts/Cartesian.as)
        > 2. Make the following addition to the local copy of Cartesian.as: In the combineDuplicateCategoryNames method, (around line 1559) change:
        > var item:Object = currentSeries.dataProvider[j];
        > to:
        > var item:Object = currentSeries.dataProvider[j];
        > if(!item) continue;
        >
        > This should allow you to successfully compile your code now. Post back if you run into any issues.
        >
        > Tripp
        >
      Your message has been successfully submitted and would be delivered to recipients shortly.