Mark,
Thanks for the code snippet. It turned out that I was having version
"issues" in getting kill() to work (it is not in v10, for example).
I have come across some interesting behavior and a code bug. First,
it is a bug that is preventing the X-axis label from appearing. Go into
ChartGenerator in the method setDomainAxisLabel. The setLabel argument
should be "val"; re: "xyplot.getDomainAxis().setLabel(val);". (Sean -
you should add this to your bug fix list).
Secondly, if one uses the panel close widget the chart will lose its
data series. If you use the hide button from the console, this behavior
does not occur. I haven't tracked down where this occurs at this time,
but obviously "hide" and panel window close are not the same in this
circumstance, but at first blush it seems that they should be. This
may, or may not, be related to your issue of losing data after
invoking kill().
I say this because I created a pre-determined series and placed it
into a chart and ran the simulation to a kill(). This series remained
displayed properly (at least until I use the close window widget!).
I could show and hide with the console without loss of proper data
chart display. My other data series and chart, however, exhibit the
exact behavior you describe. After the kill() the chart no longer
properly displays the series data. Pushing the window close button
will cause your data series to be lost, but other chart attributes
remain (e.g. titles). After the kill(), the data series remains known
to the chart as far as the series inspection area of the panel is
concerned, but it is missing from actual chart graph display area
(at least in my case, in your examples the data is piled onto a
single domain point).
The major difference that I can see is that the chart that loses the
data is being updated through calls via the schedule while with the
other chart the data series is established when the chart is
established and is not subsequently altered. Both charts are created
in the same manner and within the same object and methods. Thus, I
do not believe it is an instance of the base objects disappearing.
This appears to be an issue in how the series update notification
is being delivered to the chart, but that is also my current guess.
Currently I am killing the simulation between series updates. I may
see slightly different behavior (perhaps the data stacking you see)
if I terminate during the same time step the series is being updated.
You may wish to make some experimental runs yourself with this in
mind - perhaps setting up several different charts to see which ones
remain unaffected and which lose their series data (i.e. a fixed series
chart, one that gets updated only for the first part of the simulation,
one that gets updated infrequently, etc).
-Mike
|