This isn’t going to be a too major overhaul as I will be ‘time boxing’ , but I hope to fix some bugs and make some significant improvements.
My main aims are:
- Improve the Doxygen documentation
- 'Modernise’ the chart presentation to be more akin to charts produced by current office software
- Improve drawing speed for dynamic charts (30fps for 500 datapoints on average hardware)
- Make charts interactive, showing tooltips when hovering over data points and issuing events
1: Dataset / Serie(s) / Axis Classes
Currently there is quite a large number of Dataset derivatives most of which are a subtle subclassing of XYDataset.
My thought is to rationalize this to have 3 Dataset subclasses as follows:
- SingletonDataset
- PairDataset
- TupleDataset
A SingletonSeries is a series where the datapoints are singletons, say the ‘Y’ value, whilst the ‘X’ value is a fixed category set defined by the dataset. A singleton could sensibly be plotted as a line, a moving average, bars, even a pie-chart with no categories. The existing CategorySimpleDataset / CategorySerie would be replaced by this.
A PairSeries would contain an ‘X’ and a ‘Y’ value. These make more sense to plot as a XY Scatter Chart or a histogram. The existing series for XYSimpleDataset, VectorDataset, XYDynamicDataset and others would be replaced by this.
A TupleSeries would be for data that has more than just X and Y values. Probably, it would derive from PairSeries but with a vector member that can store 1 or more additional dimensions, so XYZSeries and a new OHLCSeries would fit here.
I was thinking about using wxAny for the series, but maybe it would be better just to be vectors. So, a PairSeries would basically be wxVector<T1,T2>. The advantage of wxAny is that I think any wxAny value can be output as a string, which obviously makes labeling easier.
2: Event Mechanism
Currently the library has its own sort of event mechanism. I am not yet sure exactly how this works, but there are a range of ‘FIRE’ macros and methods. I think that this could be entirely replaced using wxWidget’s normal event mechanism, with the advantage that appropriate events can be exposed and therefore custom handlers added.
This could be a major piece of work or it could be straightforward.
Both of these 2 changes are highly likely to break the library for existing applications and TBH I can’t really be bothered to write a compatibility layer.
I would welcome any thoughts on the above - and any other suggestions for that matter! Really, my time is quite limited for this, but it is a valuable learning exercise so I am happy to give it a go.