This content has been marked as final. Show 5 replies
Is it possible to take the database out of the equation and post a simple example that illustrates what is happening?
What version of Coldfusion are you running? We used to have this happen to us on CF 7 which I think at that point it was classified as a bug. However after upgrading the issue seemed to resolve itself when CF 8 added native connectors for a lot of the options that used to require 3rd party connectors.
I'm using CF8.
As for an example...hm, well, it's a fair bit of code, so I'll try and simplify.
The application has a LineChart, which we'll call TestChart. It has an itemClick event which calls a function called zoomTest, a dataProvider which we'll call Foo, and also has...let's say two LineSeries called m1 and m2. Each LineSeries graphs some category from Foo (we'll say it's 'sales' and 'expenses' versus 'day'). It also has a horizontalAxis with categoryField=day, a VerticalAxis, and a horizontalAxisRenderers tag set equal to the horizontalAxis.
Beneath TestChart is a DataGrid which we'll call TestDG. It has the same dataProvider (Foo), and two columns which we'll call mcol1 and mcol2. The two columns display the same data graphed in m1 and m2.
The function zoomTest is, naturally, included in a Script tag above these two. When called it changes the dataProvider for TestChart and TestDG to a different ArrayCollection called Bar. It changes the categoryField for mcol1 and mcol2 to 'sales' and 'expenses' (but these have different values than in Foo).
Additionally, zoomTest changes m1 and m2 to graph 'sales' and 'expenses' versus 'hour'. It changes the categoryField of the horizontalAxisRenderers to 'hour' as well.
Okay, well, I think I figured out the problem. Sorta. I threw in a little if-else statement into the zoomTest() function. If the dataProvider I'm switching to is null, it displays a message saying so (later on I'll .probably whip up a ProgressBar for this). Otherwise, it switches the dataProvider.
Once again, everything is fine for the DataGrid. However, when it comes time to That Darn Linechart again, it's still not switching over properly. I've since isolated it to the chart's horizontalAxis, which has a CategoryAxis (and a categoryField, of course). If I don't change the categoryField in the zoomTest() function, the graph becomes blank. If I do, however, I get an error message. What exactly is this trying to tell me?
EDIT: Interestingly enough, if I change the categoryField to something that doesn't exist in the new dataProvider, it simply displays a blank chart (sans error message). Very curious.