Bug 134195 - Chart created in OOo Calc imported incorrectly
Summary: Chart created in OOo Calc imported incorrectly
Status: RESOLVED FIXED
Alias: None
Product: calligrachart
Classification: Applications
Component: opendocument (show other bugs)
Version: unspecified
Platform: Gentoo Packages Linux
: NOR normal
Target Milestone: ---
Assignee: Inge Wallin
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-09-17 05:15 UTC by Peter Hedlund
Modified: 2009-11-10 00:33 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments
Spreadsheet with some data and a chart from OOo Calc (15.07 KB, application/vnd.oasis.opendocument.spreadsheet)
2006-09-17 05:16 UTC, Peter Hedlund
Details
New test document (25.44 KB, application/vnd.oasis.opendocument.spreadsheet)
2009-10-28 20:51 UTC, Peter Hedlund
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Peter Hedlund 2006-09-17 05:15:06 UTC
Version:           1.6 beta 1 (using KDE KDE 3.5.4)
Installed from:    Gentoo Packages
Compiler:          gcc 4.1.1 
OS:                Linux

The chart in the attached file was created in OpenOffice.org Calc. It is not rendered correctly in KSpread.
Comment 1 Peter Hedlund 2006-09-17 05:16:03 UTC
Created attachment 17803 [details]
Spreadsheet with some data and a chart from OOo Calc
Comment 2 Inge Wallin 2006-09-28 17:28:01 UTC
SVN commit 589745 by ingwa:

ODF: Create support for data in rows or columns

Yay!  This is the first ODF commit for kchart in a loooong time.  Viva
      aKademy for giving me time to actually do this.

CCBUGS: 134195

Btw, Bug 134195 is a great testcase because it is simple and yet
contains a number of things that don't work yet.



 M  +5 -0      ChangeLog  
 M  +8 -2      kchart_params.cc  


--- branches/koffice/1.6/koffice/kchart/ChangeLog #589744:589745
@@ -1,3 +1,8 @@
+2006-09-28  Inge Wallin  <inge@lysator.liu.se>
+
+	* kchart_params.cc (loadOasisPlotarea): Add support for
+	chart:series-source (row or column):
+
 2006-08-11  Inge Wallin  <inge@lysator.liu.se>
 
 	Only show checkboxes in config dialog if applicable.
--- branches/koffice/1.6/koffice/kchart/kchart_params.cc #589744:589745
@@ -572,7 +572,11 @@
     // chart:stock-with-volume      - boolean
     // chart:japanese-candle-sticks - boolean
 
-    // chart:series-source     - "row" or "columns
+    // chart:series-source     - "rows" or "columns"
+    // "columns" is the default
+    if ( styleStack.attributeNS( KoXmlNS::chart, "series-source" ) == "rows" ) {
+      setDataDirection( DataRows );
+    }
 
     // chart:data-label-number - "value" / "percentage" / "none" (def: none)
 
@@ -957,6 +961,9 @@
 	break;
     }
 
+    // chart:series-source
+    plotAreaStyle.addProperty( "chart:series-source",
+			       ( dataDirection() == DataRows ) ? "rows" : "columns" );
     // Register the style, and get back its auto-generated name
     const QString styleName = mainStyles.lookup( plotAreaStyle, "ch" );
 
@@ -965,7 +972,6 @@
     saveOasisAxis( bodyWriter, mainStyles, KDChartAxisParams::AxisPosBottom, "x" );
     saveOasisAxis( bodyWriter, mainStyles, KDChartAxisParams::AxisPosLeft, "y" );
 
-    // TODO chart:series
     // TODO chart:wall
     // TODO chart:floor
 }
Comment 3 Inge Wallin 2006-09-29 17:55:09 UTC
Just found out by looking inside the file that it actually is invalid.  The cells without value are given as "1.#NAN", which should be "NAN".  This does not mean that kchart doesn't load the file wrong in other ways, of course. I am on those, but you should also bug report the file to OpenOffice.org as invalid.
Comment 4 Inge Wallin 2009-10-20 19:22:40 UTC
Hi Peter,

2.1 is coming out soon.  Do you have the same problem with the current version of oocalc?  The file in the bugreport is actually invalid, as I wrote above.
Comment 5 Peter Hedlund 2009-10-20 19:42:28 UTC
Inge,

I wish I could help you, but KSpread in beta 3 packages from Fedora freezes for me when attempting to open or create any document. Unfortunately I don't have time to investigate the cause of that.
Comment 6 Inge Wallin 2009-10-20 22:13:24 UTC
Ok, that's serious in itself. But that's more likely a packaging problem, since I have it working here.
Comment 7 Peter Hedlund 2009-10-28 20:51:51 UTC
Created attachment 37936 [details]
New test document

The chart in the attached file does not render at all in KSpread 2.1 RC1. File created in OOo 3.1.1.
Comment 8 Inge Wallin 2009-10-28 23:57:22 UTC
Thanks, Peter.  I'll look into that.
Comment 9 Inge Wallin 2009-11-10 00:15:52 UTC
SVN commit 1046921 by ingwa:

* Make data direction load from the correct place.  That place is the
  plot-area style, not the plot-area element.

* Add some comments.

CCBUG: 134195



 M  +47 -25    PlotArea.cpp  


WebSVN link: http://websvn.kde.org/?view=rev&revision=1046921
Comment 10 Inge Wallin 2009-11-10 00:26:45 UTC
SVN commit 1046926 by ingwa:

Backport r1046921:

* Make data direction load from the correct place.  That place is the
  plot-area style, not the plot-area element.

* Add some comments.

BUG: 134195


 M  +46 -24    PlotArea.cpp  


WebSVN link: http://websvn.kde.org/?view=rev&revision=1046926
Comment 11 Inge Wallin 2009-11-10 00:33:43 UTC
The original bug that was shown in the attached file is now fixed.  A new bug is entered in bug 213917.