Issue 13699 - Error in spline generation for scatter plot if x values not in order
Summary: Error in spline generation for scatter plot if x values not in order
Status: CLOSED FIXED
Alias: None
Product: General
Classification: Code
Component: chart (show other issues)
Version: 3.3.0 or older (OOo)
Hardware: PC Windows XP
: P3 Trivial (vote)
Target Milestone: ---
Assignee: kla
QA Contact: issues@graphics
URL:
Keywords:
: 21691 62538 78334 (view as issue list)
Depends on:
Blocks:
 
Reported: 2003-04-22 11:44 UTC by dragonslayer
Modified: 2013-02-24 21:20 UTC (History)
4 users (show)

See Also:
Issue Type: PATCH
Latest Confirmation in: ---
Developer Difficulty: ---


Attachments
Different Spline curves (35.76 KB, application/octet-stream)
2003-05-20 09:23 UTC, bjoern.milcke
no flags Details
patch to allow unsorted points (6.36 KB, text/plain)
2007-07-15 22:35 UTC, Regina Henschel
no flags Details
Some cubic splines created with Excel (screenshots) rendered with the patch (72.23 KB, application/vnd.oasis.opendocument.spreadsheet)
2007-07-16 09:06 UTC, bjoern.milcke
no flags Details

Note You need to log in before you can comment on or make changes to this issue.
Description dragonslayer 2003-04-22 11:44:48 UTC
When x values are not in order such as x:{1,2,5,10,8,6} and y:{10,8,6,5,4,1}, 
the spline curve is discontinous at the maximum x value. The line reverses.
Comment 1 kla 2003-05-19 13:56:41 UTC
Hi Bjoern,
as discussed, pls have a look.
Comment 2 bjoern.milcke 2003-05-20 09:19:06 UTC
I have attached a document to illustrate the different approaches to
splines.

In OOo 1.0 (and StarOffice 6.0) we have a point where the spline is
not differentiable (it is contiuous, though).  I agree, that this is
not acceptable for a spline.

I suppose the best solution would be a spline which is not necessarily
a function, i.e. where you can have more than one point of the curve
for one x-value (like MS Excel).

For 6.1 the spline algorithm changed (because sometimes parts of or
the entire the curve were missing for certain values).  Currently it
also supports a function only, but this is done by implicit sorting by
x-values. Thus you have a real (differentiable) spline curve, but
probably not always what you expected.

We will change this in OOo 2.0 or later.
Comment 3 bjoern.milcke 2003-05-20 09:23:38 UTC
Created attachment 6290 [details]
Different Spline curves
Comment 4 bjoern.milcke 2003-09-10 16:53:04 UTC
.
Comment 5 kla 2003-09-16 13:02:06 UTC
According to the OpenOffice.org roadmap
(http://tools.openoffice.org/releases) this issue was retargeted to
OOo Later.
Comment 6 kla 2003-11-05 14:24:40 UTC
*** Issue 21691 has been marked as a duplicate of this issue. ***
Comment 7 IngridvdM 2006-03-07 12:35:29 UTC
*** Issue 62538 has been marked as a duplicate of this issue. ***
Comment 8 Regina Henschel 2007-06-12 19:52:36 UTC
*** Issue 78334 has been marked as a duplicate of this issue. ***
Comment 9 keulie_minogue 2007-06-13 10:55:13 UTC
I think the problem of the splines is, that it want to make a spline through the
next x-value available. So if splines are enabled a "location curve" or a
"Ortskurve" is not displayable when a helix should be made.

I can not explain better - sorry.

Re	0,9786	0,4200	0,8334	-0,5369	-0,4828	0,0451	0,0912	0,0473	0,0334	0,0213
0,0096	0,0063	0,0039
IM	0,0659	0,8537	-0,1372	-0,4167	0,2282	0,2681	0,0800	0,0202	0,0104	0,0047
0,0014	0,0006	0,0002

these data are in the attached RAR and you can edit the "Ortskuve" on Sheet
"Versuch" and you see that the spline goes through the x-values in line and not
from point to point from the table.

http://home1.f1.fhtw-berlin.de/s0509556/miranda/V3_-_Ortskurve.rar

Please check soon!
Comment 10 keulie_minogue 2007-06-13 10:56:39 UTC
I think the problem of the splines is, that it want to make a spline through the
next x-value available. So if splines are enabled a "location curve" or a
"Ortskurve" is not displayable when a helix should be made.

I can not explain better - sorry.

Re	0,9786	0,4200	0,8334	-0,5369	-0,4828	0,0451	0,0912	0,0473	0,0334	0,0213
0,0096	0,0063	0,0039
IM	0,0659	0,8537	-0,1372	-0,4167	0,2282	0,2681	0,0800	0,0202	0,0104	0,0047
0,0014	0,0006	0,0002

these data are in the attached RAR and you can edit the "Ortskuve" on Sheet
"Versuch" and you see that the spline goes through the x-values in line and not
from point to point from the table.

http://home1.f1.fhtw-berlin.de/s0509556/miranda/V3_-_Ortskurve.rar

Please check soon!
Comment 11 bjoern.milcke 2007-06-25 17:50:19 UTC
The problem is clear: the algorithm for spline creation is bad: it requires
sorted-by-x data.
Comment 12 Regina Henschel 2007-07-15 22:34:07 UTC
The attached patch is based on the file Splines.cxx outof CWS chart07
($Revision: 1.9.12.2 $
last change: $Author: iha $ $Date: 2007/07/10 13:46:20 $)

As for BSplines the curve has got parameter. I have not changed anything in the
local things in that file, because it is written in a generally way, that can
also handle others than natural splines and might be useful later on or in other
places. I only changed the way in which this tools are used.

There is no obvious way to set the parameters to the curve. I first tried it
with using the euclidean distance. The result was not so good, because you get
curve loops, if there are single extreme points. Now I use simple adding 1 from
point to point. But I'm no mathematic expert and if you know a better way to set
the parameters please tell me.
Comment 13 Regina Henschel 2007-07-15 22:35:09 UTC
Created attachment 46805 [details]
patch to allow unsorted points
Comment 14 bjoern.milcke 2007-07-16 08:57:43 UTC
Looks great with the patch! It is similar to the Excel splines but not exactly
the same. But IMO better. The examples I lookes at seemed a bit more homogenous
in OOo.
Comment 15 bjoern.milcke 2007-07-16 09:06:43 UTC
Created attachment 46817 [details]
Some cubic splines created with Excel (screenshots) rendered with the patch
Comment 16 bjoern.milcke 2007-07-16 09:28:06 UTC
Checked some more examples. They look all similar or better than before. Thanks
for the patch!
Comment 17 bjoern.milcke 2007-07-16 10:04:44 UTC
Please verify in CWS chart07.
Comment 18 kla 2007-07-17 08:47:56 UTC
looks good -> verified
Comment 19 kla 2007-11-23 09:41:33 UTC
Seen ok in current master -> closed