This content has been marked as final. Show 5 replies
Your chart uses a Collection for its data, right? A Collection has a filter function - a simple function that takes a single argument (a record from the data) and returns a Boolean.
When you get a change on your slider, invoke the Collection's refresh() method. That will cause the filter function to run. Now you just write the filter function:
// assuming myData is the Collection:
myData.filterFunction = testDates;
public function testDates( item:Object ) : Boolean
// test your item to see if should be visible in the chart. return true if it should, false otherwise.
Then your HSlider can do: change="myData.refresh()"
im doin something like this:
public function processFilter1(item:Object):Boolean
if(item.ts>=moteData[slider.values].ts && item.ts<=moteData[slider.values].ts)
// motedata is an array fetched from httpservice
im filtering 2 areas in my dataprovider, one is the id=1001 & date range
im getting nothing
I suggest you step through this code using the debugger. The debugger will tell you the values of the variables and their data types.
When I need to do something like this, I set up additional local variables for any values which are not local to the function:
var v0:* = moteData[slider.values];
var v1:* = moteData[slider.values];
I am using the * data type for these; the * means the anonymous type (or generic) type. This way you don't have to know what type the data is. It is just a simple way to double-check you really have the data you think you have.
The debugger will then show you the values for v0 and v1.
hey got to work the slider with multiple series, thanks
another issue is the hslider does not show me the values in sequence, how do i sort a date field, i get alphabetical sort,
eg. Fri Mon Sat Sun etc...
how do i sort the dates on the hslider?