Project

General

Profile

Bug #8093

WCartesianChart portrait size do not show the bottom axis.

Added by Apivan Tuntakurn 5 months ago. Updated 5 months ago.

Status:
New
Priority:
Normal
Assignee:
-
Target version:
-
Start date:
02/18/2021
Due date:
% Done:

0%

Estimated time:

Description

I used the code from the Wt example. C:\workspaces\wtclonegit\examples\charts\ChartExample.C
I commented out the axis location zero and add another chart with the portrait size chart->resize(500, 600). The bottom axis is not visible.


Files

CaptureWChart.PNG (247 KB) CaptureWChart.PNG Apivan Tuntakurn, 02/18/2021 09:47 AM
ChartsExample.C (15.2 KB) ChartsExample.C Apivan Tuntakurn, 02/18/2021 09:47 AM
DesiredResult.PNG (222 KB) DesiredResult.PNG Apivan Tuntakurn, 02/18/2021 10:21 AM
clipboard-202102181622-ov4rm.png (281 KB) clipboard-202102181622-ov4rm.png Apivan Tuntakurn, 02/18/2021 10:22 AM
#1

Updated by Apivan Tuntakurn 5 months ago

Reproducible on Wt github.

#2

Updated by Apivan Tuntakurn 5 months ago

This seem to fix the problem but I am not really sure what is going on.

diff --git a/src/Wt/Chart/WCartesianChart.C b/src/Wt/Chart/WCartesianChart.C
index 16855718..7396e474 100644
--- a/src/Wt/Chart/WCartesianChart.C
+++ b/src/Wt/Chart/WCartesianChart.C
@@ -3869,7 +3869,7 @@ void WCartesianChart::renderAxis(WPainter& painter, const WAxis& axis,
}
clipRect = WRectF(0.0, area.top(), isYAxis ? width_ : height_, h);
} else {

  • clipRect = WRectF(area.left(), 0.0, area.width(), isYAxis ? height_ : width_);
  • clipRect = WRectF(area.left(), 0.0, area.width(), isYAxis ? width_ : height_); } if (properties == AxisProperty::Labels) { clipRect = WRectF(clipRect.left() - 1, clipRect.top() - 1,

warning: LF will be replaced by CRLF in src/Wt/Chart/WCartesianChart.C.
The file will have its original line endings in your working directory

#3

Updated by Apivan Tuntakurn 5 months ago

(Format patch)

diff --git a/src/Wt/Chart/WCartesianChart.C b/src/Wt/Chart/WCartesianChart.C
index 16855718..7396e474 100644
--- a/src/Wt/Chart/WCartesianChart.C
+++ b/src/Wt/Chart/WCartesianChart.C
@@ -3869,7 +3869,7 @@ void WCartesianChart::renderAxis(WPainter& painter, const WAxis& axis,
       }
       clipRect = WRectF(0.0, area.top(), isYAxis ? width_ : height_, h);
     } else {
-      clipRect = WRectF(area.left(), 0.0, area.width(), isYAxis ? height_ : width_);
+      clipRect = WRectF(area.left(), 0.0, area.width(), isYAxis ?  width_ : height_);
     }
     if (properties == AxisProperty::Labels) {
       clipRect = WRectF(clipRect.left() - 1, clipRect.top() - 1, 

warning: LF will be replaced by CRLF in src/Wt/Chart/WCartesianChart.C.
The file will have its original line endings in your working directory

Also available in: Atom PDF