After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 125419 - serie can go beyond the graph boundaries
serie can go beyond the graph boundaries
Status: RESOLVED FIXED
Product: Gnumeric
Classification: Applications
Component: Charting
1.2.x
Other Linux
: Normal normal
: ---
Assigned To: Jody Goldberg
Jody Goldberg
Depends on:
Blocks:
 
 
Reported: 2003-10-24 16:49 UTC by Frederic Parrenin
Modified: 2004-12-22 21:47 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
screenshot of the problem (4.35 KB, image/png)
2003-10-24 16:50 UTC, Frederic Parrenin
  Details
Half working patch (8.89 KB, patch)
2003-10-26 20:55 UTC, Emmanuel Pacaud
none Details | Review
Preliminary patch (10.19 KB, patch)
2003-10-27 16:35 UTC, Emmanuel Pacaud
none Details | Review
Patch (21.09 KB, patch)
2003-10-29 14:03 UTC, Emmanuel Pacaud
none Details | Review

Description Frederic Parrenin 2003-10-24 16:49:57 UTC
If you zoom in on a serie in a graph (by modifying the min and max values
of the axis), the serie go beyond the graph frame. It seems to me that the
plotting of serie should restrict to the axis interval.
Comment 1 Frederic Parrenin 2003-10-24 16:50:52 UTC
Created attachment 20912 [details]
screenshot of the problem
Comment 2 Jody Goldberg 2003-10-25 05:53:18 UTC
Known problem.

Pie/Ring	: not applicable
Bar/Col		: should work in 1.2.0
Line/Area	: todo
XY		: fixed in my tree
Comment 3 Emmanuel Pacaud 2003-10-25 13:01:42 UTC
I'm working on clipping for line and area plot. Expect it for tomorrow.
Comment 4 Emmanuel Pacaud 2003-10-26 20:54:10 UTC
I tried to do the clipping at the view_render level. But it looks ugly
and tricky.

You'll find attached what I've done for now (compilable but half working).

I have the feeling it would be cleaner and as fast if done at the
renderer level, using art_svp_intersect.

Jody, how did you do for xy plot ?
Comment 5 Emmanuel Pacaud 2003-10-26 20:55:20 UTC
Created attachment 20953 [details] [review]
Half working patch
Comment 6 Jody Goldberg 2003-10-26 21:46:10 UTC
That is indeed ugly.
The code in the renderer looks like it could be simplified a bit, but
its  probably not worth the effort.  I'll tack on an optional clipping
mechanism to draw path/polygon.
Comment 7 Emmanuel Pacaud 2003-10-26 22:07:29 UTC
>The code in the renderer looks like it could be simplified a bit, but

You probably mean gog_line_view_render here...

>I'll tack on an optional clipping mechanism to draw path/polygon.

Not sure to understand who will do the work, you or me ?
Comment 8 Emmanuel Pacaud 2003-10-27 16:34:11 UTC
Please find attached a preliminary patch that does clipping at the
renderer level.

If this way of doing things is the right way, I can finish it.

The pixbuf renderer must use a temporary pixbuf at the size of the
clipping region, plot plugin that use clipping must use temporary
pixbuf coordinate system, and svg and gnome-print clipping has to be done.
Comment 9 Emmanuel Pacaud 2003-10-27 16:35:01 UTC
Created attachment 20978 [details] [review]
Preliminary patch
Comment 10 Jody Goldberg 2003-10-27 17:56:59 UTC
I took a slightly different approach and tried to do logical clipping
by adding clipping arguments to draw polygon/path.

Your suggestion is interesting and may be a better approach.

Why copy the entire region initially then blit back the subset we want
?  It seems faster to just dup the subset we want and put all of it back.

I'll leave my extensions in place because they may be useful one day,
but I prefer your approach for performance reasons.
Comment 11 Jody Goldberg 2003-10-27 19:44:55 UTC
My patch is now functional, but is not terribly happy with area plots.
 For elements with positive areas we apparently get the winding number
wrong and the clip gets things backwards.
Comment 12 Emmanuel Pacaud 2003-10-27 21:00:51 UTC
>Why copy the entire region initially then blit back the subset we want
>?  It seems faster to just dup the subset we want and put all of it
>back.

Yes, sure. It was a test patch, to see if things work. I'm going to
write it properly now.
Comment 13 Emmanuel Pacaud 2003-10-29 14:02:36 UTC
Here's a more correct patch, implementing clipping for the 3
renderers. I've left logical clipping in place.
Comment 14 Emmanuel Pacaud 2003-10-29 14:03:36 UTC
Created attachment 21037 [details] [review]
Patch
Comment 15 Jody Goldberg 2003-10-29 16:39:51 UTC
bugzilla is not ideal for patch review.  Please email it.

2 suggestions

1) Use push/pop clipregion instead of start/stop
2) Its tempting to move the push/pop up into the ChartView renderer to
avoid multiple duplications of the plotting region when there are
overlapping plots.  It loses for pies/rings, but wins for other cases
which seem more common.
Comment 16 Jody Goldberg 2003-11-03 16:20:35 UTC
patch applied.