Project

General

Profile

Ugly rendering in WCartesianChart

Added by Manuel Weichselbaumer over 1 year ago

Hi there,
i already noticed that a WCartesianChart renders fonts and lines in a worse quality than in a regular WPaintedWidget where i override:

void paintEvent(Wt::WPaintDevice *paintDevice)

I tried to override WCartesianChart::paintEvent() where i do my custom drawing like i did in a regular WPaintedWidget. However, quality is much worse in WCartesianChart.

Is there a different renderer used? How could i overcome this?

BR
Manuel


Replies (4)

RE: Ugly rendering in WCartesianChart - Added by Roel Standaert over 1 year ago

That seems strange to me. Maybe the anti-aliasing setting is different? See: https://www.webtoolkit.eu/wt/doc/reference/html/classWt_1_1WPainter.html#af859825a00ff428e773c2abeb328f078

Do you have some screenshots to demonstrate what you're talking about?

RE: Ugly rendering in WCartesianChart - Added by Manuel Weichselbaumer over 1 year ago

I checked the anti-aliasing setting and tried all combinations. I also tried several browser combinations. However, all with the same effect.

You can have a closer look, to the bars i am trying to render.
On the left side, it is the WCartesianChart, where i draw the bars to. On the right, the bars (test and icons) are drawn using WPaintedWidget.
As you can see, the text is also rendered blurry (in contrast to the other texts next to the icons).

RE: Ugly rendering in WCartesianChart - Added by Roel Standaert over 1 year ago

Is there any kind of scaling happening? Is it also blurry when you do right click -> save image as and then view the resulting PNG file at 100% scaling?

RE: Ugly rendering in WCartesianChart - Added by Manuel Weichselbaumer over 1 year ago

The chart is placed within a BoxLayout. I now set the size to a fixed size using the resize() call.
There is something else: the brush of the graph (semi-transparent orange area) is not always painted. So, depending in the browser window size the filling gets painted or not (only for chrome. working with safari, though).
Saving as PNG only works for me when using Chrome. The Png does not look blurry, however resolution seems to be too low.
Yes, apparently, there is some kind of scaling applied. However, i cannot figure out, what the difference with WPaintedWidget is...

    (1-4/4)