1 Reply Latest reply on Dec 23, 2007 9:10 PM by kathryn_trevino

    Chart weekdays only

    CJSteu
      Hi, I am building an HLOC Chart with Plot Overlays and Column for Volume, that needs to chart only the weekday values day format 1-5. I am using the Date Parse function to convert all strings to date format, and it all works good, but displays saturday and sunday values... Is there a min or max format that I can add to Chart control or any Actionsript language that will remove Saturday and Sunday?
      Here is what my actionscript code does now to parse date strings...

      public function myParseFunction(s:String):Date {
      // Get an array of Strings from the
      // comma-separated String passed in.
      var a:Array = s.split(",");

      // Trace out year, month, and day values.
      trace("d:", a[0]);
      trace("m:", a[1]);
      trace("y:", a[2]);

      // Create the new Date object.
      var newDate:Date = new Date(a[2],a[1]-(1),a[0]);
      return newDate;
      }

      And my Chart Code is:


      <mx:horizontalAxis>
      <mx:DateTimeAxis
      dataUnits="days"
      parseFunction="myParseFunction"
      />
      </mx:horizontalAxis>

      Any help is greatly appreciated.
      Craig








        • 1. Re: Chart weekdays only
          kathryn_trevino
          I continue to struggle with resolving how to chart only week-days...
          I am now using this code...
          <mx:Script><![CDATA[
          import mx.collections.ArrayCollection;

          [Bindable]
          public var minDay:Day = getDay(1);

          [Bindable]
          public var maxDay:Day = getDay(5);

          [Bindable]
          public var TICKER:ArrayCollection = new ArrayCollection([
          {date:"1, 8, 2005",open:42.57,high:43.08,low:42.08,close:42.75,volume:300},
          {date:"2, 8, 2005",open:42.89,high:43.5,low:42.61,close:43.19,volume:285},
          {date:"3, 8, 2005",open:43.19,high:43.31,low:42.77,close:43.22,volume:220},
          {date:"4, 8, 2005",open:42.89,high:43,low:42.29,close:42.71,volume:175},
          {date:"5, 8, 2005",open:42.49,high:43.36,low:42.02,close:42.99,volume:189},
          {date:"8, 8, 2005",open:43,high:43.25,low:42.61,close:42.65,volume:240},
          {date:"9, 8, 2005",open:42.93,high:43.89,low:42.91,close:43.82,volume:250},
          {date:"10, 8, 2005",open:44,high:44.39,low:43.31,close:43.38,volume:272},
          {date:"11, 8, 2005",open:43.39,high:44.12,low:43.25,close:44,volume:290},
          {date:"12, 8, 2005",open:43.46,high:46.22,low:43.36,close:46.1,volume:295},
          ]);
          [Bindable]
          public var TRADES:ArrayCollection = new ArrayCollection([
          {open:42.89, basedate:"3, 8, 2005", type:1, transdate:"10, 8, 2005",price:44.39, type:2},
          ]);

          public function myParseFunction(s:String):Date {
          // Get an array of Strings from the
          // comma-separated String passed in.
          var a:Array = s.split(",");

          // Trace out year, month, and day values.
          trace("d:", a[0]);
          trace("m:", a[1]);
          trace("y:", a[2]);

          // Create the new Date object.
          var newDate:Date = new Date(a[2],a[1]-(1),a[0]);
          return newDate;
          }

          ]]></mx:Script>


          And this.
          <mx:horizontalAxis>
          <mx:DateTimeAxis
          dataUnits="days"
          parseFunction="myParseFunction"
          minimum="{minDay}"
          maximum="{maxDay}"
          />
          </mx:horizontalAxis>


          but the error message is 1046 : Day & undefined method: GetDay

          Can anyone Help??