Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

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

Closed
anonymous-piwik-user opened this Issue · 11 comments

5 participants

Anonymous Piwik user Daniel Ziegenberg Matthieu Aubry Anthon Pang Peter Boehlke
Anonymous Piwik user

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 "[gelst] 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.

Daniel Ziegenberg

Attachment: Plots cut off at the bottom
Piwik_plots-cut-off.png

Daniel Ziegenberg

Hi!

I can verify that for our Piwik Installation: [50%)]([Image(Piwik_plots-cut-off.png,)]

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

Matthieu Aubry
Owner

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

Anthon Pang
Collaborator

Are we finally raising requirements?

Daniel 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.

Peter Boehlke
Collaborator

+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.

Anthon Pang
Collaborator

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];
                }
            }
Daniel 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.

Anthon Pang
Collaborator

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

Anthon Pang
Collaborator

OMG [4964] fixed this one too?

Daniel Ziegenberg

Confirmed! Works now.

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

Anonymous Piwik user anonymous-piwik-user added this to the 1.5.1 Piwik 1.5.1 milestone
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.