Bug #4470

Axis and series rendering order in WCartesianChart?

Added by Стойчо Стефанов Stoycho Stefanov over 7 years ago. Updated over 6 years ago.

Target version:
Start date:
Due date:
% Done:


Estimated time:



it seems to me that the rendering order should be changed as follows:

  1. render grid
  2. render axes
  3. render data series
  4. 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.


WCartesianChart.patch (1.64 KB) WCartesianChart.patch Стойчо Стефанов Stoycho Stefanov, 09/11/2015 09:49 AM

Updated by Koen Deforche over 7 years ago

  • Status changed from New to InProgress
  • Assignee set to Roel Standaert

Roel, do you see any issues with these changes? In light of interactive features perhaps?


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

Updated by Стойчо Стефанов Stoycho Stefanov about 7 years ago

Thanks for fixing it in wt-3.3.5!

Before you close this issue you could consider the case when the width is not zero and "width <= 2*pen.width()", thus the rectangle does not have to be filled.


Updated by Koen Deforche over 6 years ago

  • Status changed from Implemented @Emweb to Resolved

Updated by Koen Deforche over 6 years ago

  • Status changed from Resolved to Closed
  • Target version changed from 3.3.5 to 3.3.6

Also available in: Atom PDF