Project

General

Profile

Actions

Bug #8093

closed

WCartesianChart portrait size do not show the bottom axis.

Added by Apivan Tuntakurn almost 4 years ago. Updated almost 2 years ago.

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

100%

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
Actions #1

Updated by Apivan Tuntakurn almost 4 years ago

Reproducible on Wt github.

Actions #2

Updated by Apivan Tuntakurn almost 4 years 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

Actions #3

Updated by Apivan Tuntakurn almost 4 years 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

Actions #4

Updated by Roel Standaert almost 2 years ago

  • Status changed from New to Resolved
  • Target version set to 4.9.0

I just merged this into master, thanks.

Actions #5

Updated by Roel Standaert almost 2 years ago

  • % Done changed from 0 to 100
Actions #6

Updated by Roel Standaert almost 2 years ago

  • Target version changed from 4.9.0 to 4.8.3
Actions #7

Updated by Roel Standaert almost 2 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF