Project

General

Profile

UJWCartesianChart remove spacing

Added by Ulf Johnsson over 5 years ago

Hi.

I was wondering if it is possible to remove some of the "dead space" in charts when using WCartesianChart?
It seems like the chart does not a lot of the space available in the object, specially at the top and right side.
Is there any way to actually use this space so that the chart itself can utilice the space?

BR, Ulf.


Replies (4)

KD RE: WCartesianChart remove spacing - Added by Korneel Dumon over 5 years ago

Hi Ulf,

I think WCartesianChart::setPlotAreaPadding() allows you to do this
https://webtoolkit.eu/wt/doc/reference/html/classWt_1_1Chart_1_1WAbstractChart.html#a53819c3e834a27c2b47bd79f69363c04

UJ RE: WCartesianChart remove spacing - Added by Ulf Johnsson over 5 years ago

Hi Korneel.

I already tried that method, from what I can tell it has no effect what so ever?

UJ RE: WCartesianChart remove spacing - Added by Ulf Johnsson over 5 years ago

Oh wait I guess it does something if you first set

setAutoLayoutEnabled(false)
then
setPlotAreaPadding()
.

But then you lose the calculations for the axes, thats a pain. I just wanna trim donw the spacings a little bit.

KD RE: WCartesianChart remove spacing - Added by Korneel Dumon over 5 years ago

Indeed, it's one or the other ... the margins are fixed with auto-layout

    (1-4/4)