Axis and series rendering order in WCartesianChart?
it seems to me that the rendering order should be changed as follows:
- render grid
- render axes
- render data series
- render legend
If axes are rendered after data series (as in latest wt) it could happen that a vertical or horizontal line is covered by the axis line.
My second suggestion is to optimize bar series rendering when bar width is less or equal to the double of the pen width. I my patch I consider the case where
crisp(left) == crisp(left + width)
but it could be generalized to all cases where filling the area within the bar border is redundant.
This rendering change spares a lot of redundant plot instructions and makes a chart update much faster.
I patch currently wt by myself but it could be better to fix this in the official release.
Updated by Roel Standaert about 7 years ago
- Status changed from InProgress to Implemented @Emweb
I've applied these changes, but not quite like the patch does:
- The axis lines are drawn below the data series, but the labels are still drawn on top
- When interactive features are enabled, the bar series drawing optimization is not applied, because bar width may not be 0 depending on pan and zoom