Print

Print


I did a bunch of analysis on the computational nightmare that is
DefaultTableXYDataset. Then I took a closer look at CategoryTableXYDataset
and found that it has none of the same issues, so I made a new demo using
it (see attached). I added a simple culling mechanism that removes every
second x-value just to make sure it works. It does, but it would be a whole
lot faster if CategoryTableXYDataset exposed the function
in DefaultKeyedValues2D to remove a whole column at once. That function is
paradoxically called removeRow() because CategoryTableXYDataset thinks of X
as the row and Y as the column.

Anyway, it works even if culling is slower than need be.

I haven't made any moves toward integrating with the MASON ChartGenerator
structure. I wanted to make sure we had the right JFreeChart hooks in
place. I think we do now.

Joey

On Tue, Jun 14, 2016 at 6:17 PM, Sean Luke <[log in to unmask]> wrote:

> The fundamental problem with XYSeries is that they display everything.  So
> if you have an O(n) display issue which grows as n grows.  That's the
> reason behind MASON's DataCuller mechanism.  You're going to need to do a
> similar procedure for a stacked timeseries.
>
> I have looked over DataCuller and I think you can use exactly the same
> code.  See how it's used in TimeSeriesAttributes.  Basically the DataCuller
> is first asked if it thinks stuff should be culled (because there are too
> many points).  If so, it's then asked which points to remove.  [You could
> give it a single time series row in your dataset probably.]  Then
> TimeSeriesAttributes goes through and deletes all the points the DataCuller
> suggested.
>
> Sean
>
> On Jun 15, 2016, at 12:04 AM, Joey Harrison <[log in to unmask]> wrote:
>
> > I was using add() and what do you know, addOrUpdate() works. There are
> still some hideous inefficiencies in DefaultTableXYDataset. I don't think I
> can use XYSeriesCollection because
> ChartFactory.createStackedXYAreaChart(...) expects a TableXYDataset. I'll
> have a look at CategoryTableXYDataset.
> >
> > Thanks,
> > Joey
> >
> > On Tue, Jun 14, 2016 at 5:23 PM, Sean Luke <[log in to unmask]> wrote:
> > On Jun 14, 2016, at 9:49 PM, Joseph F Harrison <[log in to unmask]> wrote:
> >
> > > Option A) Version based on TimeTableXYDataset.
> >
> > This is the wrong dataset.  Don't use it.
> >
> > > Option B) Version that uses a DefaultTableXYDataset to store the data.
> >
> > You might also try CategoryTableXYDataset or XYSeriesCollection.
> Anyway...
> >
> > > Here's what happens: DefaultTableXYDataset listens to the change event
> for all the XYSeries you add to it. Whenever you add a value to any series
> with a previously unseen x-value (e.g. x=1), it adds a dummy entry to all
> the other series. Then, when you try to add a value (at x=1) to another
> series, it sees the dummy value already there (at x=1) and throws a
> SeriesException: X-value already exists.
> >
> > Are you using add() or are you using addOrUpdate()?  The latter would
> probably work, no?
> >
> > Sean
> >
>