Opened 3 years ago

Closed 3 years ago

Last modified 3 years ago

#2504 closed Bug (fixed)

Charts - charts cropped at bottom (PHP 5.1.x)

Reported by: ts77 Owned by:
Priority: major Milestone: 1.5.1 Piwik 1.5.1
Component: Core Keywords:
Cc: Sensitive: no

Description

We got a report in the german forum that there were issues with the new jplot charts when php 5.1 was used (see topic "[gelöst] Besucher-Graph nach update auf 1.5"). The charts were cut off in the bottom and the div which holds the canvas (class="jqplot-axis jqplot-yaxis" ) has only 2 canvas elements instead of 3 in the regular view.
Upgrading to php 5.2 fixed that for at least one user.

Attachments (1)

Piwik_plots-cut-off.png (35.2 KB) - added by ziegenberg 3 years ago.
Plots cut off at the bottom

Download all attachments as: .zip

Change History (16)

comment:1 Changed 3 years ago by SteveG (sgiehl)

  • Milestone set to 1.6 Piwik 1.6

Changed 3 years ago by ziegenberg

Plots cut off at the bottom

comment:2 Changed 3 years ago by ziegenberg

Hi!

I can verify that for our Piwik Installation: Plots cut off at the bottom

We use a CentOS 5.5 Installation with a custom PHP 5.1.6 build but we cannot update the PHP version. We'd be happy to help finding what's the cause.

greetings, Daniel

comment:3 Changed 3 years ago by vipsoft (robocoder)

  • Component changed from Core to UI (templates, javascript)
  • Priority changed from normal to major
  • Summary changed from issues with the new jplot charts on php 5.1.x to php 5.1.6: jplot charts cropped

comment:4 Changed 3 years ago by matt (mattab)

  • Resolution set to wontfix
  • Status changed from new to closed

5.1.6 is from Aug 2006, ie. 5 year old. Not going to fix this issue on such old version since issue is not critical

comment:5 Changed 3 years ago by vipsoft (robocoder)

Are we finally raising requirements?

comment:6 Changed 3 years ago by ziegenberg

Well, this is a "critical" bug for all user who are forced to use some old PHP as the charts are crap to use and how should someone supposed to use the core functionality (analytics) of piwik if he can't read the graphs?
By the way the minimum requirement is still PHP 5.1.3 so it would be very nice if you could fix this.

comment:7 Changed 3 years ago by peterb (peterbo)

+1 for raising requirements; I understand the frustration if somebody is stuck up with an old PHP version, but we'll end up with tons of complex legacy-code if we workaround everything.

comment:8 follow-up: Changed 3 years ago by vipsoft (robocoder)

  • Resolution wontfix deleted
  • Status changed from closed to reopened

I took a quick look at the jqplot code, and it looks like a .js bug (i.e., not php 5.1.x specific). Can you guys test this patch?

In libs/jqplot/jqplot.lineRenderer.js, change this:

            // calculate the bounding box
            var xmin = xmax = ymin = ymax = null;
            for (i=0; i<this._areaPoints.length; i++) {
                var p = this._areaPoints[i];
                if (xmin > p[0] || xmin == null) {
                    xmin = p[0];
                }
                if (ymax < p[1] || ymax == null) {
                    ymax = p[1];
                }
                if (xmax < p[0] || xmax == null) {
                    xmax = p[0];
                }
                if (ymin > p[1] || ymin == null) {
                    ymin = p[1];
                }
            }

to:

            // calculate the bounding box
            var xmin = xmax = ymin = ymax = null;
            for (i=0; i<this._areaPoints.length; i++) {
                var p = this._areaPoints[i];
                if (xmin > p[0] || xmin === null) {
                    xmin = p[0];
                }
                if (ymax < p[1] || ymax === null) {
                    ymax = p[1];
                }
                if (xmax < p[0] || xmax === null) {
                    xmax = p[0];
                }
                if (ymin > p[1] || ymin === null) {
                    ymin = p[1];
                }
            }

comment:9 in reply to: ↑ 8 Changed 3 years ago by ziegenberg

Replying to vipsoft:

I took a quick look at the jqplot code, and it looks like a .js bug (i.e., not php 5.1.x specific).

I tested it, but it did not help.

comment:10 Changed 3 years ago by vipsoft (robocoder)

Did you delete the files in tmp/assets/* and clear your browser cache?

comment:11 Changed 3 years ago by vipsoft (robocoder)

  • Resolution set to fixed
  • Status changed from reopened to closed

OMG [4964] fixed this one too?

comment:12 Changed 3 years ago by vipsoft (robocoder)

  • Component changed from UI (templates, javascript) to Core

comment:13 Changed 3 years ago by vipsoft (robocoder)

  • Summary changed from php 5.1.6: jplot charts cropped to php 5.1.x: jplot charts cropped

comment:14 Changed 3 years ago by ziegenberg

Confirmed! Works now.

@vipsoft: Thank you very much! I really appreciate fixing this bug! You saved me from several days of work.

comment:15 Changed 3 years ago by vipsoft (robocoder)

  • Summary changed from php 5.1.x: jplot charts cropped to Charts - charts cropped at bottom (PHP 5.1.x)
Note: See TracTickets for help on using tickets.