Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Thanks to Heikki for his help. The following code works to use the axis values to draw on your Cartesian Data Canvas:</p> <pre><code>chtCanvas.drawRect(axisDate.minimum as Date, axisSalary.maximum, axisDate.maximum as Date, axisSalary.minimum); </code></pre> <p>Casting the values as Date really helped. The rest of the code used above is unecessary.</p> <p>One thing to note, I was using a DateFormatter to format the date values from my data. What I didn't consider was that when using a DateTimeAxis, Flex will automatically add in extra dates to display on the axis. In my case, I was using a custom parse function to create MY points, but wasnt considering the points Flex was creating and also passing to my parse function (Therefore, they were not getting parsed correctly). Once I corrected this, the values laid out correctly in the case of multiple data points. I'm still having a bit of an issue with single data points and them not filling the chart entirely, but they are now drawing.</p> <p><strong>UPDATE</strong>: Although there are signs of life, the minimum and maximum are still not drawing the entire width of the chart in some cases depending on the dataUnits and labelUnits combination.</p> <p>UPDATE #2: SOLVED Ok, so the axis does work as minimum/maximum values for the Cartesian Data Canvas but there is something important to remember. For a single point (and probably for multiple points as well, I just couldnt visually see the difference), when using a custom DateTimeAxis parse function such as what was in the Adobe Flex ASDoc tutorials:</p> <pre><code>private function axisDateParseFunction(item:String):Date { var inputDate:String = item; inputDate = fmtDate.format(inputDate); var newDate:Date = new Date(); if(inputDate) { var a:Array = inputDate.split('/'); newDate.fullYear = a[2]; newDate.month = a[0] - 1; newDate.date = a[1]; newDate.hours = 0; newDate.hoursUTC = 0; newDate.minutes = 0; newDate.minutesUTC = 0; newDate.seconds = 0; newDate.secondsUTC = 0; newDate.milliseconds = 0; newDate.millisecondsUTC = 0; } return newDate; } </code></pre> <p>You MUST remember to set the UTC values as shown above also. Since the DateTimeAxis uses date AND time, when you create new Date objects, their time values also get set to the local system time. Remember to set those values to zero also or you will get points that dont exactly line up with your axis labels.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload