Okay, try this scenario: Can you change the dataprovider of a series or chart on demand from within the program while it is running? So no matter why I¹m doing it, I have say four completely different dataproviders collecting data from say a static in-line source, a static XML file source and a couple dynamically generated by whatever means.
Then do this, have four primary combobox¹s each related to a series in the chart. These first combobox¹s will select the dataProvider of each series (this works when statically set). Then you have an additional four comboboxs which will set the yAxis of each chart series based on the selected dataProvider (conditional combobox which changes based on what the first combobox has been set to). See what you have now? The ability to analyze different data sets from different sources within the same chart. The way it works now, the assumption is that this data can always be lumped into a single array, which isn¹t always the case especially when dealing with an application designed for an engineering application. It would just be far simpler to be able to change dataprovider on the fly and tell the chart to update or reload. So how could this be done? Reload or recreate the chart based on a click or change event? -- Blair From: Tracy Spratt <[EMAIL PROTECTED]> Reply-To: <flexcoders@yahoogroups.com> Date: Thu, 21 Aug 2008 19:59:07 -0400 To: <flexcoders@yahoogroups.com> Conversation: [flexcoders] Re: Change dataProvider at runtime? Subject: RE: [flexcoders] Re: Change dataProvider at runtime? If I understand correctly, the OP has separate calls to get the data for the four lists. If so, what is the problem? Just assign the dataProvider as needed. You are using result handlers, storing the data in instance variables, and not trying to bind directly to lastResult, correct? Tracy From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Amy Sent: Thursday, August 21, 2008 2:33 PM To: flexcoders@yahoogroups.com Subject: [flexcoders] Re: Change dataProvider at runtime? --- In flexcoders@yahoogroups.com <mailto:flexcoders%40yahoogroups.com> , "cox.blair" <[EMAIL PROTECTED]> wrote: > > Does anyone have experience with changing a dataprovider at runtime? > > Scenerio: a grocery store Database has four tables, one for Produce, > Dairy, Meat and Other. Each of the tables is a different > arrayCollection/HTTPService > > I want to be able to have four comboboxes, each able to point to any > of the four arrayCollection's, therefore to change the datasource of > each series in a chart. > > Why? Because it would allow you to compare values of different data > sets in a single chart. I did not expect this would be such an issue. > > If anyone can provide any information at all, it would be a huge help. Preferred method: If you have any control over the database, FIX THE DESIGN. If not, use a UNION query to normalize the data, then use a filter function to filter on grocery type and refresh the ArrayCollection. Icky method: If you have no control over the backend at all, then you can use something like myChart.dataProvider = nastyArrayCollection ;-) HTH; Amy